install-artifact-from-github
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -15,3 +15,5 @@ #!/usr/bin/env node | ||
const getPlatform = () => { | ||
const platform = process.platform; | ||
let platform = process.env.npm_config_platform; | ||
if (platform) return platform; | ||
platform = process.platform; | ||
if (platform !== 'linux') return platform; | ||
@@ -27,4 +29,7 @@ // detecting musl using algorithm from https://github.com/lovell/detect-libc under Apache License 2.0 | ||
}; | ||
const platform = getPlatform(); | ||
const platform = getPlatform(), | ||
platformArch = process.env.npm_config_platform_arch || process.arch, | ||
platformABI = process.env.npm_config_platform_abi || process.versions.modules; | ||
const isParamPresent = name => process.argv.indexOf('--' + name) > 0; | ||
@@ -70,4 +75,3 @@ | ||
if (!result) return null; | ||
const host = mirrorHost || process.env[mirrorEnvVar] || 'https://github.com'; | ||
let assetUrl = host; | ||
let assetUrl = mirrorHost || process.env[mirrorEnvVar] || 'https://github.com'; | ||
if (!skipPath && !process.env[skipPathVar]) { | ||
@@ -79,3 +83,3 @@ assetUrl += `/${result[1]}/${result[2]}/releases/download`; | ||
} | ||
assetUrl += `/${prefix}${platform}-${process.arch}-${process.versions.modules}${suffix}`; | ||
assetUrl += `/${prefix}${platform}-${platformArch}-${platformABI}${suffix}`; | ||
return assetUrl; | ||
@@ -113,2 +117,6 @@ }; | ||
const isVerified = async () => { | ||
if (process.env.npm_config_platform || process.env.npm_config_platform_arch || process.env.npm_config_platform_abi) { | ||
console.log(`Fetched for the custom platform "${platform}-${platformArch}-${platformABI}" -- skipping the verification.`); | ||
return true; | ||
} | ||
try { | ||
@@ -115,0 +123,0 @@ if (process.env.npm_package_scripts_verify_build) { |
{ | ||
"name": "install-artifact-from-github", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Create binary artifacts hosted by github and install them without compiling.", | ||
@@ -30,3 +30,6 @@ "homepage": "https://github.com/uhop/install-artifact-from-github", | ||
"author": "Eugene Lazutkin <eugene.lazutkin@gmail.com> (https://lazutkin.com/)", | ||
"license": "BSD-3-Clause" | ||
"license": "BSD-3-Clause", | ||
"scripts": { | ||
"test": "node tests/test-env.js" | ||
} | ||
} |
@@ -60,2 +60,3 @@ # install-artifact-from-github [![NPM version][npm-img]][npm-url] | ||
- 1.3.1 *added a way to specify a custom build, thx (Grisha Pushkov)[https://github.com/reepush] + a test.* | ||
- 1.3.0 *enhanced support for custom mirrors.* | ||
@@ -62,0 +63,0 @@ - 1.2.0 *support for NPM >= 7.* |
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 3 instances 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
18857
348
70
33