build-version
Advanced tools
Comparing version 0.2.1 to 0.2.2
11
index.js
'use strict'; | ||
const path = require('path'); | ||
const { exec } = require('child_process'); | ||
@@ -77,7 +78,9 @@ const username = require('username'); | ||
const config = Object.assign({}, option); | ||
return getTagVersion({ cwd : config.cwd }) | ||
const cwd = path.resolve(config.cwd || ''); | ||
return getTagVersion({ cwd }) | ||
.catch(() => { | ||
return headHash({ | ||
short : true, | ||
cwd : config.cwd | ||
cwd | ||
}); | ||
@@ -87,6 +90,6 @@ }) | ||
(version) => { | ||
return suffix(version, { cwd : config.cwd }); | ||
return suffix(version, { cwd }); | ||
}, | ||
() => { | ||
return readPkgUp({ cwd : config.cwd }).then((data) => { | ||
return readPkgUp({ cwd }).then((data) => { | ||
if (data && data.pkg && data.pkg.version) { | ||
@@ -93,0 +96,0 @@ return data.pkg.version; |
{ | ||
"name": "build-version", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Get a version for your build.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/sholladay/build-version", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21366
93