diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d3980d2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.history.mash diff --git a/main.py b/main.py index 743cbb9..fd28b9e 100755 --- a/main.py +++ b/main.py @@ -11,12 +11,13 @@ from os.path import expanduser # Some initial variables user = os.getlogin() +mashLocation = os.getcwd() + "/" initDirectory = expanduser("~") argList = ["", ""] # Start work on checking whether a config file exists if os.path.isfile(expanduser("~") + "/.config/mash/mash.conf") == False: - configFilePath = "/etc/mash/mash.conf" + configFilePath = mashLocation + "mash.conf" else: configFilePath = (expanduser("~") + "/.config/mash/mash.conf") # Parse config file, adding variables @@ -85,7 +86,7 @@ for word in confArgList: elif word == 'lblue': colourCodes.append('\033[14m') # Write the time to the history file -historyFile = open((expanduser("~") + "/.history.mash"), "a") +historyFile = open((mashLocation + "/.history.mash"), "a") historyFile.write("\n") historyFile.write(("Session on " + str(datetime.now()))) historyFile.write("\n") @@ -189,7 +190,7 @@ def mainLoop(startDir): print("Command", command, "either doesn't exist, isn't in the path or isn't in this directory.") # Write to the history file - historyFile = open((expanduser("~") + "/.history.mash"), "a") + historyFile = open((mashLocation + "/.history.mash"), "a") historyFile.write(command) historyFile.write("\n") historyFile.close() diff --git a/mash.conf.example b/mash.conf similarity index 100% rename from mash.conf.example rename to mash.conf