@enonic/cli-test
Advanced tools
Comparing version 0.0.46 to 0.0.47
{ | ||
"name": "@enonic/cli-test", | ||
"description": "Command-line interface for Enonic XP", | ||
"version": "0.0.46", | ||
"version": "0.0.47", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
@@ -24,3 +24,31 @@ #!/usr/bin/env node | ||
// Mapping from Node's `process.arch` to Golang's `$GOARCH` | ||
const ARCH_MAPPING = { | ||
"ia32": "386", | ||
"x64": "amd64_v1", | ||
"arm": "arm" | ||
}; | ||
// Mapping between Node's `process.platform` to Golang's | ||
const PLATFORM_MAPPING = { | ||
"darwin": "darwin", | ||
"linux": "linux", | ||
"win32": "windows", | ||
"freebsd": "freebsd" | ||
}; | ||
module.exports = { | ||
getBinaryPath: () => { | ||
const opts = this.parsePackageJson(); | ||
if (!opts) { | ||
console.error("Invalid package.json"); | ||
} | ||
const binaryPath = path.join(".", 'dist', `${opts.project}_${PLATFORM_MAPPING[process.platform]}_${ARCH_MAPPING[process.arch]}`); | ||
if (!fs.existsSync(binaryPath)) { | ||
console.error(`${binaryPath} not found in the installed package`); | ||
return; | ||
} | ||
return path.join(binaryPath, opts.binName); | ||
}, | ||
parsePackageJson: () => { | ||
@@ -27,0 +55,0 @@ const packageJsonPath = path.join(".", "package.json"); |
@@ -24,4 +24,2 @@ #!/usr/bin/env node | ||
const dirName = process.cwd(); | ||
function parsePackageJson() { | ||
@@ -44,10 +42,9 @@ if (!(process.arch in ARCH_MAPPING)) { | ||
parsePackageJson(); | ||
const binaryPath = helper.getBinaryPath(); | ||
console.log('__dirname: ', __dirname); | ||
console.log('process.env.INIT_CWD: ', process.env.INIT_CWD); | ||
console.log('process.cwd(): ', process.cwd()); | ||
console.log(path.dirname(require.main.filename)); | ||
console.log('binary path: ', binaryPath); | ||
process.env | ||
const { execFile } = require('child_process'); | ||
execFile(binaryPath, argv); | ||
} |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
95551532
220
3
3