install-artifact-from-github
Advanced tools
Comparing version 1.1.3 to 1.2.0
@@ -55,6 +55,3 @@ #!/usr/bin/env node | ||
const getAssetUrlPrefix = () => { | ||
const url = | ||
process.env.npm_package_github || | ||
process.env.npm_package_repository || | ||
(process.env.npm_package_repository_type === 'git' && process.env.npm_package_repository_url), | ||
const url = process.env.npm_package_github || (process.env.npm_package_repository_type === 'git' && process.env.npm_package_repository_url), | ||
result = getRepo(url), | ||
@@ -145,2 +142,19 @@ host = mirrorHost || process.env[mirrorEnvVar] || 'https://github.com'; | ||
checks: { | ||
if (process.env.npm_package_json && /\bpackage\.json$/i.test(process.env.npm_package_json)) { | ||
// for NPM >= 7 | ||
try { | ||
// read the package info | ||
const pkg = JSON.parse(await fsp.readFile(process.env.npm_package_json)); | ||
// populate necessary environment variables locally | ||
process.env.npm_package_github = pkg.github || ''; | ||
process.env.npm_package_repository_type = (pkg.repository && pkg.repository.type) || ''; | ||
process.env.npm_package_repository_url = (pkg.repository && pkg.repository.url) || ''; | ||
process.env.npm_package_version = pkg.version || ''; | ||
process.env.npm_package_scripts_verify_build = (pkg.scripts && pkg.scripts['verify-build']) || ''; | ||
process.env.npm_package_scripts_test = (pkg.scripts && pkg.scripts.test) || ''; | ||
} catch (error) { | ||
console.log('Could not retrieve and parse package.json.'); | ||
break checks; | ||
} | ||
} | ||
if (!artifactPath) { | ||
@@ -147,0 +161,0 @@ console.log('No artifact path was specified with --artifact.'); |
{ | ||
"name": "install-artifact-from-github", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"description": "Create binary artifacts hosted by github and install them without compiling.", | ||
@@ -19,4 +19,4 @@ "homepage": "http://github.com/uhop/install-artifact-from-github", | ||
"bin": { | ||
"install-from-cache": "./bin/install-from-cache.js", | ||
"save-to-github-cache": "./bin/save-to-github-cache.js" | ||
"install-from-cache": "bin/install-from-cache.js", | ||
"save-to-github-cache": "bin/save-to-github-cache.js" | ||
}, | ||
@@ -23,0 +23,0 @@ "keywords": [ |
@@ -60,2 +60,3 @@ # install-artifact-from-github [![NPM version][npm-img]][npm-url] | ||
- 1.2.0 *support for NPM >= 7.* | ||
- 1.1.3 *technical release: updated docs.* | ||
@@ -62,0 +63,0 @@ - 1.1.2 *technical release: updated docs.* |
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 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 1 instance in 1 package
17425
321
68
25