Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
Passing 'step' as argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Telmo Silva committed Apr 13, 2020
1 parent 7bbb142 commit bcdd4da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 9 additions & 1 deletion install.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

import configparser
import argparse, configparser

# global variables
path = "/tmp/tali.ini"
Expand All @@ -11,8 +11,16 @@ def write_config_file():
config.write(config_file)

def main():
parser = argparse.ArgumentParser()
parser.add_argument("--step", default=0)
args = parser.parse_args()

config.read(path)

if args.step != 0: # if a step was passed as an argument, use it
config["DEFAULT"] = { 'Step': args.step }
write_config_file()

if config.read(path) == []: # no config file found
config["DEFAULT"] = { 'Step': '1' }
write_config_file()
Expand Down
3 changes: 1 addition & 2 deletions steps/step2.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
os.system("pacstrap /mnt python wget")
os.system("genfstab -U /mnt >> /mnt/etc/fstab")
os.system("cp -r /root/tali /mnt/tali")
os.system("cp /tmp/tali.ini /mnt/tmp")
os.system("arch-chroot /mnt python tali/install.py")
os.system("arch-chroot /mnt python tali/install.py --step 3")

0 comments on commit bcdd4da

Please sign in to comment.