clean-publish
Advanced tools
Comparing version 1.0.1 to 1.0.2
#!/usr/bin/env node | ||
var fs = require('fs'); | ||
var fse = require('fs-extra'); | ||
var CONFIG_FILES_LIST = require('./config-files-list'); | ||
const fs = require('fs'); | ||
const fse = require('fs-extra'); | ||
const omit = require('lodash.omit'); | ||
const { | ||
spawn, | ||
execSync, | ||
} = require('child_process'); | ||
(function() { | ||
var tmp = './tmp'; | ||
fs.mkdirSync(tmp); | ||
fs.readdirSync('./').forEach(function(i) { | ||
if (i !== 'tmp') { | ||
if (CONFIG_FILES_LIST.indexOf(i) == -1 || fs.statSync(i).isDirectory()) { | ||
fse.copy(i, `${tmp}/${i}`); | ||
const IGNORE_FILES = require('./ignore-files'); | ||
const IGNORE_FIELDS = require('./ignore-fields'); | ||
(function () { | ||
const tmp = fs.mkdtempSync('tmp'); | ||
const src = './' | ||
const packageJSON = 'package.json' | ||
fs.readdirSync(src).forEach(i => { | ||
if (i !== tmp) { | ||
if (IGNORE_FILES.indexOf(i) == -1 || fs.statSync(i).isDirectory()) { | ||
fse.copy(i, `${tmp}/${i}`) | ||
.then(() => { | ||
if (i === packageJSON) { | ||
fse.readJson(packageJSON, (err, obj) => { | ||
fse.writeJsonSync(`./${tmp}/${packageJSON}`, omit(obj, IGNORE_FIELDS), { | ||
spaces: 2 | ||
}) | ||
}) | ||
} | ||
}); | ||
} | ||
} | ||
}) | ||
process.chdir(tmp); | ||
const publish = spawn('npm', ['publish'], { | ||
stdio: 'inherit' | ||
}); | ||
})(); | ||
publish.on('exit', () => { | ||
fse.removeSync(tmp); | ||
}) | ||
process.chdir('../'); | ||
})(); |
{ | ||
"name": "clean-publish", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Clean your package before publish", | ||
@@ -24,4 +24,5 @@ "keywords": [ | ||
"dependencies": { | ||
"fs-extra": "^6.0.1" | ||
"fs-extra": "^6.0.1", | ||
"lodash.omit": "^4.5.0" | ||
} | ||
} |
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
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
3285
7
60
2
1
+ Addedlodash.omit@^4.5.0
+ Addedlodash.omit@4.5.0(transitive)