|
@@ -35,7 +35,12 @@ function set_version() {
|
|
|
function restore_version_file() {
|
|
function restore_version_file() {
|
|
|
local version_file="${ROOT_DIR}/gpustack/__init__.py"
|
|
local version_file="${ROOT_DIR}/gpustack/__init__.py"
|
|
|
local pyproject_file="${ROOT_DIR}/pyproject.toml"
|
|
local pyproject_file="${ROOT_DIR}/pyproject.toml"
|
|
|
- git checkout -- "${version_file}" "${pyproject_file}"
|
|
|
|
|
|
|
+ # In Docker build contexts (bind mounts), files may not be tracked by git.
|
|
|
|
|
+ # Since the wheel is already built, restoration is only needed for local dev.
|
|
|
|
|
+ if git ls-files --error-unmatch "${version_file}" &>/dev/null && \
|
|
|
|
|
+ git ls-files --error-unmatch "${pyproject_file}" &>/dev/null; then
|
|
|
|
|
+ git checkout -- "${version_file}" "${pyproject_file}"
|
|
|
|
|
+ fi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#
|
|
#
|