Socket
Socket
Sign inDemoInstall

@enonic/cli-test

Package Overview
Dependencies
Maintainers
5
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@enonic/cli-test - npm Package Compare versions

Comparing version 0.0.46 to 0.0.47

2

package.json
{
"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);
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc