deployment = make_deployment() # uses chdir
+ # turn this into some kind of assert
if not deployment.configured:
raise NotConfiguredError(deployment.location)
os.unsetenv("GIT_DIR") # prevent some perverse errors
+ # XXX: turn this into a context
try:
try:
os.open(".scripts-migrate-lock", os.O_CREAT | os.O_EXCL)
raise DirectoryLockedError
elif e.errno == errno.EACCES:
raise command.PermissionsError(dir)
+ raise
make_repository(sh, options, repo, tag)
check_variables(deployment, options)
finally:
parser.add_option("--dry-run", dest="dry_run", action="store_true",
default=False, help="Prints would would be run without changing anything")
parser.add_option("--force", "-f", dest="force", action="store_true",
- default=False, help="If .git or .scripts directory already exists, delete them and migrate")
+ default=False, help="If .git or .scripts directory already exists,"
+ "delete them and migrate")
options, args = parser.parse_all(argv)
if len(args) > 1:
parser.error("too many arguments")
def check_if_tag_exists(sh, repo, tag, version):
# check if the version we're trying to convert exists. We assume
- # a convention here, namely, v1.2.3-scripts is what we want. If
+ # a convention here, namely, app-1.2.3-scripts is what we want. If
# you broke the convention... shame on you.
try:
sh.call("git", "--git-dir", repo, "rev-parse", tag)