Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9156da688d |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.history.mash
|
7
main.py
7
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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user