-
-
Save moonburnt/9e3b54d4290b046e83e9755b8f75cc2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if __name__ == "__main__": | |
#this function can be moved everywere, I just didnt want to make another gist | |
def dirmaker(dir): | |
try: | |
os.makedirs(dir) | |
except FileExistsError: | |
if os.path.isdir(dir): | |
pass | |
else: | |
error("{} exists but isnt directory. Abort".format(dir)) #probably not the best to handle this, but whatever | |
sys.exit(1) | |
except: | |
raise | |
sys.exit(1) | |
if platform.system() == "Linux": | |
dirmaker(DATA_PATH) | |
dirmaker(CONFIG_PATH) | |
dirmaker(TEMP_PATH) | |
#the rest remains unchanged below |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment