linux-tools/modules/command-line tools/cmd_tools.py

20 lines
627 B
Python
Raw Normal View History

import json
import subprocess
2019-12-30 00:33:25 +01:00
from AbstractModule import AbstractModule
class CmdToolsModule(AbstractModule):
def run(self):
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)
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.")