Fix wrong input for subprocess, remove output capturing
Concat apt command entirely before execution.
This commit is contained in:
parent
f5cd3c6234
commit
9ec51fa959
@ -9,11 +9,11 @@ class CmdToolsModule(AbstractModule):
|
||||
print("Try to install basic Command-line tools")
|
||||
|
||||
with open("modules/command-line tools/programs.json") as config_file:
|
||||
programms_list = json.load(config_file)
|
||||
programs_json = json.load(config_file)
|
||||
programs_list = ""
|
||||
for program in programs_json:
|
||||
programs_list += " " + program
|
||||
|
||||
out = subprocess.run(["apt", "install"] + programms_list, shell=True, capture_output=True)
|
||||
if len(out.stderr) > 0:
|
||||
print(out.stderr.decode())
|
||||
print("Install might be not complete, please check output above.")
|
||||
else:
|
||||
print("Installed successful.")
|
||||
subprocess.run("sudo apt install" + programs_list, shell=True)
|
||||
|
||||
print("Script ran to completion.")
|
||||
|
Loading…
Reference in New Issue
Block a user