Fix v2 packaging convert script (_common.sh may not exist)
This commit is contained in:
parent
55e2b5d0dd
commit
0749b9fd6f
1 changed files with 5 additions and 2 deletions
|
@ -101,8 +101,8 @@ def _convert_v1_manifest_to_v2(app_path):
|
|||
manifest["resources"]["ports"][f"{name}.exposed"] = exposed
|
||||
|
||||
maybequote = "[\"'\"'\"']?"
|
||||
apt_dependencies = check_output(f"sed -nr 's/.*_dependencies={maybequote}(.*){maybequote}? *$/\\1/p' '{app_path}/scripts/_common.sh' | tr -d '\"' | sed 's@ @\\n@g'")
|
||||
php_version = check_output(f"sed -nr 's/^ *YNH_PHP_VERSION={maybequote}(.*){maybequote}?$/\\1/p' '{app_path}/scripts/_common.sh' | tr -d \"\\\"'\"")
|
||||
apt_dependencies = check_output(f"sed -nr 's/.*_dependencies={maybequote}(.*){maybequote}? *$/\\1/p' '{app_path}/scripts/_common.sh' 2>/dev/null | tr -d '\"' | sed 's@ @\\n@g'")
|
||||
php_version = check_output(f"sed -nr 's/^ *YNH_PHP_VERSION={maybequote}(.*){maybequote}?$/\\1/p' '{app_path}/scripts/_common.sh' 2>/dev/null | tr -d \"\\\"'\"")
|
||||
if apt_dependencies.strip():
|
||||
if php_version:
|
||||
apt_dependencies = apt_dependencies.replace("${YNH_PHP_VERSION}", php_version)
|
||||
|
@ -283,6 +283,9 @@ def cleanup_scripts_and_conf(folder):
|
|||
|
||||
script = f"{folder}/scripts/{s}"
|
||||
|
||||
if not os.path.exists(script):
|
||||
continue
|
||||
|
||||
content = open(script).read()
|
||||
|
||||
for pattern in patterns_to_remove_in_scripts:
|
||||
|
|
Loading…
Reference in a new issue