Skip to content

Commit

Permalink
Fix: Install Script!
Browse files Browse the repository at this point in the history
  • Loading branch information
antony-jr committed Mar 12, 2018
1 parent b487076 commit 314404a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"username" : "antony-jr",
"repo" : "QArchive",
"mkdir" : {
"QArchive",
"QArchive/src",
"QArchive/include"
},
Expand All @@ -30,6 +29,17 @@

def installPackage(config):
print("Installing " + config["repo"])
# Make parent directory first.
if os.path.isfile(config["repo"]):
print("Deleting duplicate file(s)... ")
os.remove(config["repo"])
os.mkdir(config["repo"])
else:
if os.path.exists("QArchive"):
rmtree("QArchive")
else:
os.mkdir("QArchive")

for i in config["mkdir"]:
print("Creating Directory " + i)
if os.path.exists(i):
Expand All @@ -45,8 +55,7 @@ def installPackage(config):
fp.write(it)
fp.close()

print("Thank you for choosing "+config["repo"])
print("Successfully Installed "+config["repo"] + "!")
print("Installed "+config["repo"]+".")
return True

if __name__ == "__main__":
Expand Down

0 comments on commit 314404a

Please sign in to comment.