skift-org/skift

sk.sh: should warn the user in a friendly way in case of invalid arguments

jackdevuk opened this issue · 3 comments

Hi!

sk.sh builds perfectly fine, however when using the command ./sk.sh run, it fails to run skift.

macOS Output (Monterey 12.4)

$ ./sk.sh run
ninja: no work to do.
Traceback (most recent call last):
  File "/Users/jack/Downloads/skift-main/.sk/sk.py", line 518, in <module>
    CMDS[sys.argv[1]](o['opts'], o['args'])
  File "/Users/jack/Downloads/skift-main/.sk/sk.py", line 460, in run_cmd
    exe = manifests[args[0]]["out"]
IndexError: list index out of range

Arch Linux Output

$ ./sk.sh run
[13/13] clang++ -o .build/2ee34575/bin...fsanitize=address -fsanitize=undefined
Traceback (most recent call last):
  File "/home/jack/skift/.sk/sk.py", line 518, in <module>
    CMDS[sys.argv[1]](o['opts'], o['args'])
  File "/home/jack/skift/.sk/sk.py", line 460, in run_cmd
    exe = manifests[args[0]]["out"]
IndexError: list index out of range

Never mind, I figured out the args I needed to use for it to run. This was me just being stupid.

I think this is a valid bug, sk.sh should print a friendly error message in this case

Sounds good