archive-tool
Advanced tools
Comparing version 1.0.0-rc.1 to 1.0.0
@@ -23,6 +23,3 @@ 'use strict'; | ||
installNode: false, | ||
installDeps: { | ||
mode: 'npm', | ||
registry: 'https://registry.npm.taobao.org' | ||
}, | ||
installDeps: false, | ||
archive: {}, | ||
@@ -71,9 +68,15 @@ ...config | ||
installDeps(target, options) { | ||
const { cwd, installDeps } = { | ||
const { cwd, mode, registry } = { | ||
cwd: target || this.config.target, | ||
installDeps: this.config.installDeps, | ||
mode: 'npm', | ||
registry: 'https://registry.npm.taobao.org', | ||
...this.config.installDeps, | ||
...options | ||
}; | ||
console.log(chalk.green(`------ start ${installDeps.mode} install --production dependencies ------ `)); | ||
const result = shell.exec(`${installDeps.mode} install --production --registry ${installDeps.registry || ''}`, { | ||
console.log(chalk.green(`------ start ${mode} install --production dependencies ------ `)); | ||
const cmdArgs = [`${mode} install --production`]; | ||
if (registry && (mode === 'npm' || mode === 'cnpm')) { | ||
cmdArgs.push(`--registry ${registry}`); | ||
} | ||
const result = shell.exec(cmdArgs.join(' '), { | ||
cwd, | ||
@@ -85,3 +88,3 @@ shell: '/bin/bash' | ||
} | ||
console.log(chalk.green(`------ ${installDeps.mode} install --production dependencies successfully ------ `)); | ||
console.log(chalk.green(`------ ${mode} install --production dependencies successfully ------ `)); | ||
} | ||
@@ -107,3 +110,3 @@ | ||
console.log(chalk.green(`------ create archive ${archiveFormat} file successfully ------`)); | ||
console.log(chalk.green(`------ archive ${archiveFormat} file: ${target} `)); | ||
console.log(chalk.green(`------ archive ${archiveFormat} file path: ${target} `)); | ||
return target; | ||
@@ -110,0 +113,0 @@ } |
{ | ||
"name": "archive-tool", | ||
"version": "1.0.0-rc.1", | ||
"version": "1.0.0", | ||
"description": "archive files to zip/tar", | ||
@@ -37,3 +37,3 @@ "keywords": [ | ||
"test": "nyc --reporter=html --reporter=text mocha --timeout=1000000", | ||
"cov": "nyc report --reporter=lcov && codecov --token=e971d1e7-39e2-44b1-b1ee-f4345b0adbee", | ||
"cov": "nyc report --reporter=lcov && codecov --token=a16dbaf4-fd0e-4c30-8337-555619d75f0b", | ||
"ci": "npm run lint && npm run cov", | ||
@@ -40,0 +40,0 @@ "ii": "npm install --registry https://registry.npm.taobao.org" |
@@ -32,4 +32,23 @@ # archive-tool | ||
**Node>8.6.0** | ||
## Install | ||
```bash | ||
npm install archive-tool | ||
``` | ||
## Usage | ||
```js | ||
const Archive = require('archive-tool'); | ||
const archive = new Archive({ | ||
source: ['src', 'lib', 'package.json'], | ||
target: 'dist' | ||
}); | ||
archive.zip(); | ||
``` | ||
## License | ||
[MIT](LICENSE) |
@@ -31,3 +31,2 @@ 'use strict'; | ||
expect(archive.config.installNode).to.be.false; | ||
expect(archive.config.installDeps.mode).to.equal('npm'); | ||
}); | ||
@@ -34,0 +33,0 @@ it('should set options test', () => { |
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
13497
246
0
54