aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/deploy_release.py45
1 files changed, 23 insertions, 22 deletions
diff --git a/scripts/deploy_release.py b/scripts/deploy_release.py
index 52805738f..69eb71010 100644
--- a/scripts/deploy_release.py
+++ b/scripts/deploy_release.py
@@ -20,15 +20,19 @@ import shutil
import subprocess
-def read_version(repo_root):
- """Read the version from VERSION.txt."""
- version_file = repo_root / "VERSION.txt"
- if not version_file.exists():
- print(f"Error: VERSION.txt not found at {version_file}", file=sys.stderr)
- sys.exit(1)
-
- version = version_file.read_text().strip()
- print(f"Version: {version}")
+def read_version(repo_root, version_override=None):
+ """Read the version from VERSION.txt or use the provided override."""
+ if version_override:
+ version = version_override
+ print(f"Version: {version} (from --version)")
+ else:
+ version_file = repo_root / "VERSION.txt"
+ if not version_file.exists():
+ print(f"Error: VERSION.txt not found at {version_file}", file=sys.stderr)
+ sys.exit(1)
+
+ version = version_file.read_text().strip()
+ print(f"Version: {version} (from VERSION.txt)")
return version
@@ -235,12 +239,12 @@ def main():
parser.add_argument(
"output_dir",
type=Path,
- help="Directory where artifacts will be copied"
+ help="Directory where artifacts will be copied (should be the root of a UE p4 workspace)"
)
parser.add_argument(
- "--version-file",
- type=Path,
- help="Path to VERSION.txt (default: auto-detect from script location)"
+ "--version",
+ type=str,
+ help="Version to download (default: read from VERSION.txt)"
)
parser.add_argument(
"-v", "--verbose",
@@ -250,16 +254,13 @@ def main():
args = parser.parse_args()
- # Determine repository root
- if args.version_file:
- repo_root = args.version_file.parent
- else:
- # Assume script is in scripts/ directory
- script_dir = Path(__file__).resolve().parent
- repo_root = script_dir.parent
+ # Determine repository root (for reading VERSION.txt if needed)
+ # Assume script is in scripts/ directory
+ script_dir = Path(__file__).resolve().parent
+ repo_root = script_dir.parent
- # Read version
- version = read_version(repo_root)
+ # Read version (from --version option or VERSION.txt)
+ version = read_version(repo_root, args.version)
# Create output directory if it doesn't exist
output_dir = args.output_dir.resolve()