Comparing version 3.1.0 to 3.1.1
@@ -39,9 +39,9 @@ 'use strict'; | ||
(0, _child_process.exec)('git fetch --tags', function (error, stdout, stderr) { | ||
if (error) return callback(new Error('Could not fetch tags: `${stderr}`')); | ||
if (error) return callback(new Error('Could not fetch tags: ' + stderr)); | ||
(0, _child_process.exec)('git describe --abbrev=0 --tags', function (descErr, stdout, stderr) { | ||
(0, _gitRefs2['default'])(function (err, refs) { | ||
if (err) return callback(new Error('Could not get refs: `${stderr}`')); | ||
if (err) return callback(new Error('Could not get refs: ' + stderr)); | ||
var cohash = refs.get(descErr ? 'HEAD' : 'tags/' + stdout.trim()); | ||
(0, _child_process.exec)('git checkout ' + cohash + ' ' + opts.paths.join(' '), function (error, stdout, stderr) { | ||
if (error) return callback(new Error('Could not checkout paths: `${stderr}`')); | ||
if (error) return callback(new Error('Could not checkout paths: ' + stderr)); | ||
var pkg = JSON.parse((0, _fs.readFileSync)('package.json').toString()); | ||
@@ -52,3 +52,3 @@ var tmpDep = pkg.dependencies; | ||
(0, _child_process.exec)('npm install', function (error, stdout, stderr) { | ||
if (error) return callback(new Error('Could not install dependencies: `${stderr}`')); | ||
if (error) return callback(new Error('Could not install dependencies: ' + stderr)); | ||
pkg.dependencies = tmpDep; | ||
@@ -55,0 +55,0 @@ (0, _fs.writeFileSync)('package.json', JSON.stringify(pkg, null, 2) + '\n'); |
@@ -25,9 +25,9 @@ import { exec } from 'child_process' | ||
exec('git fetch --tags', (error, stdout, stderr) => { | ||
if (error) return callback(new Error('Could not fetch tags: `${stderr}`')) | ||
if (error) return callback(new Error(`Could not fetch tags: ${stderr}`)) | ||
exec('git describe --abbrev=0 --tags', (descErr, stdout, stderr) => { | ||
gitRefs((err, refs) => { | ||
if (err) return callback(new Error('Could not get refs: `${stderr}`')) | ||
if (err) return callback(new Error(`Could not get refs: ${stderr}`)) | ||
let cohash = refs.get(descErr ? 'HEAD' : `tags/${stdout.trim()}`) | ||
exec(`git checkout ${cohash} ${opts.paths.join(' ')}`, (error, stdout, stderr) => { | ||
if (error) return callback(new Error('Could not checkout paths: `${stderr}`')) | ||
if (error) return callback(new Error(`Could not checkout paths: ${stderr}`)) | ||
let pkg = JSON.parse(readFileSync('package.json').toString()) | ||
@@ -38,3 +38,3 @@ const tmpDep = pkg.dependencies | ||
exec('npm install', (error, stdout, stderr) => { | ||
if (error) return callback(new Error('Could not install dependencies: `${stderr}`')) | ||
if (error) return callback(new Error(`Could not install dependencies: ${stderr}`)) | ||
pkg.dependencies = tmpDep | ||
@@ -41,0 +41,0 @@ writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n') |
@@ -48,3 +48,3 @@ { | ||
}, | ||
"version": "3.1.0" | ||
"version": "3.1.1" | ||
} |
11466