Kaydet (Commit) 543f7b63 authored tarafından ğ's avatar ğ

fix script mode

üst ee34102d
......@@ -119,7 +119,9 @@ if __name__ == "__main__":
break
cmd = cmd.decode("utf-8")
else:
cmd = script.readline()
cmd = script.readline().replace("\n","")
if script.tell() == os.fstat(script.fileno()).st_size:
exit(0)
if cmd.strip()=='exit':
ui.info(_('Bye!'))
break
......@@ -131,8 +133,12 @@ if __name__ == "__main__":
os.system(os.environ["SHELL"])
else:
os.system(cmd)
elif cmd.startswith('#') or len(cmd) == 0:
continue
else:
cli = InaryCLI(cmd.split())
cli.run_command()
except Exception as e:
ui.error(str(e))
if script:
exit(1)
import os
exit(os.system("inarysh ./inary-script.ish"))
#!/usr/bin/inarysh
!pwd
list-installed
info inary
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment