Skip to content

Commit

Permalink
Don't duplicate version number, instead read it from project.clj.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcgrana committed Feb 21, 2010
1 parent bfd212e commit 8328e37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/clj/fleetdb.clj

This file was deleted.

12 changes: 9 additions & 3 deletions src/clj/fleetdb/server.clj
@@ -1,15 +1,17 @@
(ns fleetdb.server
(:use (fleetdb util))
(:use (fleetdb util)
(clojure.contrib [def :only (defvar-)]))
(:require (fleetdb [file :as file] [thread-pool :as thread-pool]
[lint :as lint] [embedded :as embedded])
fleetdb
(clj-stacktrace [repl :as stacktrace])
(clojure.contrib [str-utils :as str-utils])
(clojure.contrib [str-utils :as str-utils] [duck-streams :as du])
(clj-json [core :as json]))
(:import (java.net ServerSocket Socket InetAddress)
(java.io BufferedWriter OutputStreamWriter
BufferedReader InputStreamReader)
(org.codehaus.jackson JsonParseException)
(clojure.lang RT)
(fleetdb FleetDBException)
(joptsimple OptionParser OptionSet OptionException))
(:gen-class))
Expand Down Expand Up @@ -121,6 +123,10 @@
(defn- parse-int [s]
(and s (Integer/decode s)))

(let [stream (.getResourceAsStream (RT/baseLoader) "project.clj")
version (nth (read-string (du/slurp* stream)) 2)]
(defvar- fleetdb-version version))

(defn -main [& args]
(let [args-array (into-array String args)
opt-parser (OptionParser. "f:ep:a:t:x:vh")
Expand All @@ -129,7 +135,7 @@
(.has opt-set "h")
(print-help)
(.has opt-set "v")
(println fleetdb/version)
(println fleetdb-version)
(not (or (.has opt-set "f") (.has opt-set "e")))
(println "You must specify either -e or -f <path>. Use -h for help.")
:else
Expand Down

0 comments on commit 8328e37

Please sign in to comment.