Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added code to create the 'games' directory if it does not exist (it d…

…oesn't

initially).
  • Loading branch information...
commit c62b7591a4b9603ba5edbf7b3fb87f1789900d22 1 parent 69fab86
@tmciver tmciver authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/crosscram_ws/resources/game.clj
View
6 src/crosscram_ws/resources/game.clj
@@ -71,7 +71,11 @@ dimensions dim-1 and dim-2."
(assoc :timestamp (java.util.Date.))
(assoc :bot1 (clojure.core/get bots 0))
(assoc :bot2 (clojure.core/get bots 1)))
- fname (str "games/" gidstr ".clj")]
+ gamedir "games"
+ fname (str gamedir "/" gidstr ".clj")]
+ (let [dir (java.io.File. gamedir)]
+ (when (not (.exists dir))
+ (.mkdir dir)))
(with-open [wrtr (io/writer fname)]
(binding [*print-dup* true
*out* wrtr]
Please sign in to comment.
Something went wrong with that request. Please try again.