Mercurial > vba-clojure
changeset 134:718abf3bec8a
removed hardcoded /home/r/ strings from paths and made them relative to user.home
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sun, 18 Mar 2012 00:56:29 -0500 |
parents | 424510993296 |
children | eb6ba88088d3 |
files | clojure/com/aurellem/gb_driver.clj clojure/com/aurellem/vbm.clj |
diffstat | 2 files changed, 8 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
1.1 --- a/clojure/com/aurellem/gb_driver.clj Sun Mar 18 00:33:00 2012 -0500 1.2 +++ b/clojure/com/aurellem/gb_driver.clj Sun Mar 18 00:56:29 2012 -0500 1.3 @@ -7,8 +7,10 @@ 1.4 ;; Savestates 1.5 (defrecord SaveState [data]) 1.6 1.7 +(def user-home (File. (System/getProperty "user.home"))) 1.8 + 1.9 (def ^:dynamic *save-state-cache* 1.10 - (File. "/home/r/proj/pokemon-escape/save-states/")) 1.11 + (File. user-home "proj/pokemon-escape/save-states/")) 1.12 1.13 (def current-state (atom nil)) 1.14 1.15 @@ -41,10 +43,10 @@ 1.16 (Gb/loadVBA) 1.17 1.18 (def yellow-rom-image 1.19 - (File. "/home/r/proj/pokemon-escape/roms/yellow.gbc")) 1.20 + (File. user-home "proj/pokemon-escape/roms/yellow.gbc")) 1.21 1.22 (def yellow-save-file 1.23 - (File. "/home/r/proj/pokemon-escape/roms/yellow.sav")) 1.24 + (File. user-home "proj/pokemon-escape/roms/yellow.sav")) 1.25 1.26 (def on? (atom nil)) 1.27
2.1 --- a/clojure/com/aurellem/vbm.clj Sun Mar 18 00:33:00 2012 -0500 2.2 +++ b/clojure/com/aurellem/vbm.clj Sun Mar 18 00:56:29 2012 -0500 2.3 @@ -6,7 +6,7 @@ 2.4 ;;;;;;;;;;;;; read vbm file 2.5 2.6 (def ^:dynamic *moves-cache* 2.7 - (File. "/home/r/proj/pokemon-escape/moves/")) 2.8 + (File. user-home "proj/pokemon-escape/moves/"))) 2.9 2.10 (defn buttons [mask] 2.11 (loop [buttons [] 2.12 @@ -115,11 +115,12 @@ 2.13 2.14 (use 'clojure.java.shell) 2.15 2.16 +(def vba-linux (File. user-home "bin/vba-linux")) 2.17 2.18 (defn play-vbm [#^File vbm] 2.19 (.delete yellow-save-file) 2.20 (if (.exists vbm) 2.21 - (sh "/home/r/bin/vba-linux" 2.22 + (sh (.getCanonicalPath vba-linux) 2.23 (str "--playmovie=" (.getCanonicalPath vbm)) 2.24 (.getCanonicalPath yellow-rom-image))) 2.25 nil)