diff options
author | Rasmus Luha <rasmus.luha@gmail.com> | 2022-03-16 03:29:12 +0200 |
---|---|---|
committer | Rasmus Luha <rasmus.luha@gmail.com> | 2022-03-16 03:29:12 +0200 |
commit | b73753d56bbcd28732d283cc3c2aa65fd88f99bf (patch) | |
tree | ea56a60c7c58661bc8109599af25c92b057ffe81 /utils/osSpecific.py | |
parent | b88db78b1e2885d51f3edd7084d5026b400daa35 (diff) |
if __main__ added
Diffstat (limited to 'utils/osSpecific.py')
-rw-r--r-- | utils/osSpecific.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/utils/osSpecific.py b/utils/osSpecific.py new file mode 100644 index 0000000..7caf664 --- /dev/null +++ b/utils/osSpecific.py @@ -0,0 +1,25 @@ +import os +import sys + +# terminal commands, which are unfortunately os-specific + +def whichOs(): + if sys.platform == "win32": + return "windows" + else: + return "good" # ...right? + +def deleteDataDir(): + if whichOs() == "windows": + os.system("rmdir \s Data") + else: + os.system("rm -r Data") + + +def addDataDir(): + if whichOs() == "windows": + os.system("mkdir Data\Players") + else: + os.system("mkdir -p Data/Players") + print("Created new empty Data directory") + |