Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

Commit

Permalink
ensure node.js v4
Browse files Browse the repository at this point in the history
  • Loading branch information
rksm committed May 28, 2016
1 parent cce0eb9 commit 4c25eb2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
Binary file modified cloxp-installer.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion make-release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/bash

release="pre-0.0.8";
release="0.2.0";

lein do clean, uberjar;
cp target/cloxp-installer-0.1.0-standalone.jar cloxp-installer.jar;
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:license {:name "MIT License"
:url "http://opensource.org/licenses/MIT"}
:url "http://github.com/cloxp/cloxp-installer"
:dependencies [[org.clojure/clojure "1.6.0"]]
:dependencies [[org.clojure/clojure "1.7.0"]]
:scm {:url "[email protected]:cloxp/cloxp-installer.git"}
:pom-addition [:developers [:developer
[:name "Robert Krahn"]
Expand Down
17 changes: 13 additions & 4 deletions src/rksm/cloxp_installer/main.clj
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,20 @@
(apply shell/sh (split command-string #" ")))
(apply shell/sh (split command-string #" "))))

(defn match-version
[version-string]
(if-let [[parsed major minor patch] (re-find #"([0-9]+)\.([0-9]+)\.([0-9]+)" version-string)]
{:major (read-string major)
:minor (read-string minor)
:patch (read-string patch)}))

(defn assert-bin
[name command]
[name command & [version-check required-version]]
(let [{:keys [exit out err]} (cmd command)]
(if-not (zero? exit)
(install-error name " does not seem to be installed"))))
(when-not (zero? exit)
(install-error name " does not seem to be installed"))
(when (and version-check (not (version-check out)))
(install-error name " does not seem to be installed in the required version " required-version))))

(defn assert-command-succeeds
([command]
Expand All @@ -128,7 +137,7 @@
[_]
(println "1. Checking dependencies...")
(assert-bin "Leiningen" "lein --version")
(assert-bin "node.js" "node --version")
(assert-bin "node.js" "node --version" (fn [v] (let [{:keys [major]} (match-version v)] (= 4 major))) "v4.x")
(assert-bin "npm" "npm --version")
(assert-bin "git" "git --version"))

Expand Down

0 comments on commit 4c25eb2

Please sign in to comment.