You've already forked greyhack
do not fail if default binaries aren't there
This commit is contained in:
18
provision.py
18
provision.py
@@ -72,9 +72,20 @@ def downloaded_program_lines(name: str, destination: str) -> list[str]:
|
||||
var = variable_name(Path(name))
|
||||
return [
|
||||
f'{var}_bin = cp.File(home + "/{name}")',
|
||||
f'if not {var}_bin then exit("Missing downloaded program: {name}")',
|
||||
f'{var}_bin.move("{destination}", "{name}")',
|
||||
*install_file_lines(var, f"{destination}/{name}", name),
|
||||
f'if not {var}_bin then',
|
||||
f'\tprint("Missing downloaded program: {name}")',
|
||||
f'else',
|
||||
f'\t{var}_bin.move("{destination}", "{name}")',
|
||||
f'\t{var}_bin = cp.File("{destination}/{name}")',
|
||||
f'\tif not {var}_bin then',
|
||||
f'\t\tprint("Failed to install {name}")',
|
||||
f'\telse',
|
||||
f'\t\t{var}_bin.set_group("root")',
|
||||
f'\t\t{var}_bin.set_owner("root")',
|
||||
f'\t\t{var}_bin.chmod("u+rwx,g+rx,o+rx")',
|
||||
f'\tend if',
|
||||
f'end if',
|
||||
"",
|
||||
]
|
||||
|
||||
|
||||
@@ -88,6 +99,7 @@ def build_provision() -> str:
|
||||
'home = "/home/" + active_user',
|
||||
"NL = char(10)",
|
||||
'cp.create_folder(home, "source")',
|
||||
'cp.create_folder(home, "guest")',
|
||||
"",
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user