diff --git a/main.py b/main.py index 7140202..f3243ae 100755 --- a/main.py +++ b/main.py @@ -20,10 +20,11 @@ argList = ["", ""] # Start work on checking whether a config file exists if os.path.isfile(expanduser("~") + "/.config/mash/mash.conf") == False: - print("Config file does not exist. Make a file at .config/mash/mash.conf to configure things") - + configFilePath = "/etc/mash/mash.conf" +else: + configFilePath = (expanduser("~") + "/.config/mash/mash.conf") # Parse config file, adding variables -configFileFile = open((expanduser("~") + "/.config/mash/mash.conf")) +configFileFile = open(configFilePath) configFile = configFileFile.read() confArgNumber = 0 @@ -80,7 +81,8 @@ def mainLoop(startDir): # Set directory and prompt for input. os.chdir(currentDirectory) command = input(Fore.GREEN + user + Fore.WHITE + "@" + socket.gethostname() + Fore.BLUE + " " + currentDirectory + Fore.WHITE + " > ") - + if command == "" : + mainLoop(currentDirectory) # Clean some things up for the argument parser. argNumber = 0 argList.clear()