Comparing version 1.1.0-rc2 to 1.1.0
@@ -287,11 +287,22 @@ 'use strict'; | ||
if (extPkg && extPkg.files && extPkg.files.length) { | ||
let tmpPath = `/tmp/stdlib-addon.tgz`; | ||
!fs.existsSync('/tmp') && fs.mkdirSync('/tmp'); | ||
fs.existsSync(tmpPath) && fs.unlinkSync(tmpPath); | ||
fs.writeFileSync(tmpPath, extPkg.files); | ||
let command = spawnSync('tar', `-xzf ${tmpPath} -C ${servicePath}`.split(' '), {stdio: [0, 1, 2]}); | ||
let tmpPath = path.join(path.parse(process.cwd()).root, 'tmp'); | ||
let tarPath = path.join(tmpPath, 'stdlib-addon.tgz'); | ||
!fs.existsSync(tmpPath) && fs.mkdirSync(tmpPath); | ||
fs.existsSync(tarPath) && fs.unlinkSync(tarPath); | ||
fs.writeFileSync(tarPath, extPkg.files); | ||
let tarCommands = ['-xzf', tarPath]; | ||
// Win32 support | ||
/^win/.test(process.platform) && tarCommands.push('--force-local'); | ||
let command = spawnSync( | ||
'tar', | ||
tarCommands, | ||
{ | ||
stdio: [0, 1, 2], | ||
cwd: servicePath | ||
} | ||
); | ||
fs.unlinkSync(tarPath); | ||
if (command.status !== 0) { | ||
console.log(chalk.bold.yellow('Warn: ') + 'Error extracting addon package files'); | ||
return callback(new Error(`Could not install template ${extPkgName}`)); | ||
} | ||
fs.unlinkSync(tmpPath); | ||
} | ||
@@ -305,4 +316,13 @@ | ||
console.log(); | ||
let command = spawnSync('npm', ['install'], {stdio: [0, 1, 2], cwd: servicePath}); | ||
let command = spawnSync( | ||
/^win/.test(process.platform) ? 'npm.cmd' : 'npm', | ||
['install'], | ||
{ | ||
stdio: [0, 1, 2], | ||
cwd: servicePath, | ||
env: process.env | ||
} | ||
); | ||
if (command.status !== 0) { | ||
console.log(command.error); | ||
console.log(chalk.bold.yellow('Warn: ') + 'Error with npm install'); | ||
@@ -309,0 +329,0 @@ } |
{ | ||
"name": "lib", | ||
"version": "1.1.0-rc2", | ||
"version": "1.1.0", | ||
"description": "Standard Library for Microservices", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
85686
1945
2
33