OSDN Git Service

パス指定方法変更
authorNakajima <fl.kouhei@gmail.com>
Thu, 11 Apr 2019 14:18:11 +0000 (23:18 +0900)
committerNakajima <fl.kouhei@gmail.com>
Thu, 11 Apr 2019 14:18:11 +0000 (23:18 +0900)
src/serene-setup-wizard

index f11dd4b..7119ff3 100755 (executable)
@@ -20,16 +20,19 @@ def add_tasks(_list, _tasks) :
 
 interface = Interfaces.CUI()
 
+# current directory
+PATH = os.path.dirname(os.path.abspath(__file__))
+
 # make users enter password to run this program on sudo
 subprocess.call(["sudo", "echo"])
 
 # if the directory "../data" does not exist, make it.
-if not os.path.exists("../data") :
-    subprocess.call(["sudo", "mkdir", "../data"])
+if not os.path.exists(PATH + "/../data") :
+    subprocess.call(["sudo", "mkdir", PATH + "/../data"])
 
 print("Welcome to serene-wizard!!\n")
 
-if not os.path.exists("../data/not_first_time") :
+if not os.path.exists(PATH + "/../data/not_first_time") :
     
     items = Items.getItems_first_time(interface)
     
@@ -64,7 +67,7 @@ if not os.path.exists("../data/not_first_time") :
     print("Done!")
     print("See you again!!\n")
 
-    subprocess.call(["sudo", "touch", "../data/not_first_time"])
+    subprocess.call(["sudo", "touch", PATH + "/../data/not_first_time"])
 
 else :