From 66836adbc35d7b5a857fae0e009ac14912a43a93 Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 29 Oct 2012 12:14:04 +0400 Subject: [PATCH] fix getVersion for install -c --- install.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install.js b/install.js index 730fc12c..53e8c454 100644 --- a/install.js +++ b/install.js @@ -42,6 +42,10 @@ function getVersion(path) { return fs.readFileSync(path + "/.git-ref", "utf8"); if (fs.existsSync(path + "/.git/ORIG_HEAD")) return fs.readFileSync(path + "/.git/ORIG_HEAD", "utf8"); + if (fs.existsSync(path + "/.sourcemint/source.json")) { + var json = fs.readFileSync(path + "/.sourcemint/source.json", "utf8"); + return JSON.parse(json).url.split("/").pop(); + } } if (process.argv.indexOf("-c") > 0) try {