summaryrefslogtreecommitdiff
path: root/utils/osSpecific.py
diff options
context:
space:
mode:
authorRasmus Luha <rasmus.luha@gmail.com>2022-03-16 03:29:12 +0200
committerRasmus Luha <rasmus.luha@gmail.com>2022-03-16 03:29:12 +0200
commitb73753d56bbcd28732d283cc3c2aa65fd88f99bf (patch)
treeea56a60c7c58661bc8109599af25c92b057ffe81 /utils/osSpecific.py
parentb88db78b1e2885d51f3edd7084d5026b400daa35 (diff)
if __main__ added
Diffstat (limited to 'utils/osSpecific.py')
-rw-r--r--utils/osSpecific.py25
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")
+