Check the deployment dir exists when syncing

Roy Crihfield 2025-10-19 21:14:49 +08:00
parent d0041bc820
commit 693259473e
1 changed files with 2 additions and 0 deletions

View File

@ -474,6 +474,8 @@ def create_operation(deployment_command_context, spec_file, deployment_dir, sync
if opts.o.debug:
print(f"Syncing existing deployment at {deployment_dir_path}")
else:
if sync:
error_exit(f"--sync requires that {deployment_dir_path} already exists")
os.mkdir(deployment_dir_path)
# Copy spec file and the stack file into the deployment dir
copyfile(spec_file, deployment_dir_path.joinpath(constants.spec_file_name))