mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
deploy: refactor main
This commit is contained in:
parent
e2366bb7e2
commit
6a47d36303
1 changed files with 6 additions and 5 deletions
|
@ -156,19 +156,20 @@ def rexec(hosts, cmd):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
op = argv[1]
|
op = argv[1]
|
||||||
args = argv[2:]
|
hosts = expand(argv[2])
|
||||||
|
args = argv[3:]
|
||||||
|
|
||||||
if op in ["boot", "switch", "test"]:
|
if op in ["boot", "switch", "test"]:
|
||||||
apply(op, expand(args[0]))
|
apply(op, hosts)
|
||||||
|
|
||||||
elif op == "check":
|
elif op == "check":
|
||||||
check(expand(args[0]))
|
check(hosts)
|
||||||
|
|
||||||
elif op == "push":
|
elif op == "push":
|
||||||
push(expand(args[0]))
|
push(hosts)
|
||||||
|
|
||||||
elif op == "exec":
|
elif op == "exec":
|
||||||
rexec(expand(args[0]), args[1:])
|
rexec(hosts, args)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("Invalid op:", op)
|
print("Invalid op:", op)
|
||||||
|
|
Loading…
Reference in a new issue