clean-release
Advanced tools
Comparing version 2.8.0 to 2.9.0
@@ -31,2 +31,14 @@ "use strict"; | ||
} | ||
function statAsync(file) { | ||
return new Promise((resolve) => { | ||
fs.stat(file, (error, stats) => { | ||
if (error) { | ||
resolve(undefined); | ||
} | ||
else { | ||
resolve(stats); | ||
} | ||
}); | ||
}); | ||
} | ||
const subProcesses = []; | ||
@@ -60,5 +72,21 @@ function exec(command, options) { | ||
} | ||
const config = argv.config || 'clean-release.config.js'; | ||
let configFilePath; | ||
if (argv.config) { | ||
configFilePath = path.resolve(process.cwd(), argv.config); | ||
} | ||
else { | ||
configFilePath = path.resolve(process.cwd(), 'clean-release.config.ts'); | ||
const stats = await statAsync(configFilePath); | ||
if (!stats || !stats.isFile()) { | ||
configFilePath = path.resolve(process.cwd(), 'clean-release.config.js'); | ||
} | ||
} | ||
if (configFilePath.endsWith('.ts')) { | ||
require('ts-node/register/transpile-only'); | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const configData = require(path.resolve(process.cwd(), config)); | ||
let configData = require(configFilePath); | ||
if (configData.default) { | ||
configData = configData.default; | ||
} | ||
const packageJsonPath = path.resolve(process.cwd(), 'package.json'); | ||
@@ -65,0 +93,0 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires |
{ | ||
"name": "clean-release", | ||
"version": "2.8.0", | ||
"version": "2.9.0", | ||
"description": "A CLI tool to copy files to be released into a tmp clean directory for npm publishing, electronjs packaging, docker image creation, or deployment", | ||
"main": "index.js", | ||
"main": "dist/core.js", | ||
"types": "dist/core.d.ts", | ||
"scripts": { | ||
@@ -32,16 +33,17 @@ "build": "clean-scripts build", | ||
"@types/mkdirp": "1.0.0", | ||
"@types/node": "13.13.4", | ||
"@types/node": "13.13.5", | ||
"@types/rimraf": "3.0.0", | ||
"@types/semver": "7.1.0", | ||
"@types/tmp": "0.2.0", | ||
"@typescript-eslint/eslint-plugin": "2.30.0", | ||
"@typescript-eslint/parser": "2.30.0", | ||
"@typescript-eslint/eslint-plugin": "2.31.0", | ||
"@typescript-eslint/parser": "2.31.0", | ||
"clean-scripts": "1.12.3", | ||
"eslint": "6.8.0", | ||
"eslint": "7.0.0", | ||
"eslint-config-prettier": "6.11.0", | ||
"eslint-plugin-plantain": "0.1.2", | ||
"eslint-plugin-plantain": "1.0.0", | ||
"jasmine": "3.5.0", | ||
"markdownlint-cli": "0.22.0", | ||
"markdownlint-cli": "0.23.0", | ||
"no-unused-export": "1.10.3", | ||
"type-coverage": "2.4.3", | ||
"ts-node": "8.10.1", | ||
"type-coverage": "2.5.0", | ||
"typescript": "3.8.3" | ||
@@ -48,0 +50,0 @@ }, |
@@ -19,3 +19,3 @@ # clean-release | ||
run `clean-release` or `clean-release --config clean-release.config.js` | ||
run `clean-release` or `clean-release --config clean-release.config.js` or `clean-release --config clean-release.config.ts` | ||
@@ -22,0 +22,0 @@ ## config |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
16831
6
241
22