opencollective-postinstall
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -9,23 +9,7 @@ #!/usr/bin/env node | ||
const { | ||
npm_package_name, | ||
npm_package_collective_url, | ||
npm_package_collective_logo, | ||
npm_package_collective_suggested_donation_amount, | ||
npm_package_collective_suggested_donation_interval, | ||
npm_lifecycle_event, | ||
npm_config_user_agent | ||
npm_lifecycle_event | ||
} = process.env; | ||
function getDonateURL() { | ||
let donate_url = npm_package_collective_url; | ||
if (npm_package_collective_suggested_donation_amount) { | ||
donate_url += `/donate/${npm_package_collective_suggested_donation_amount}`; | ||
if (npm_package_collective_suggested_donation_interval) { | ||
donate_url += `/${npm_package_collective_suggested_donation_interval}`; | ||
} | ||
donate_url += (npm_config_user_agent.match(/yarn/)) ? '/yarn' : '/npm'; | ||
} | ||
return donate_url; | ||
} | ||
function init() { | ||
@@ -66,4 +50,3 @@ const promises = []; | ||
} else { | ||
console.log("init"); | ||
init(); | ||
} |
@@ -5,2 +5,22 @@ const execSync = require('child_process').execSync; | ||
const { | ||
npm_package_name, | ||
npm_package_collective_url, | ||
npm_package_collective_suggested_donation_amount, | ||
npm_package_collective_suggested_donation_interval, | ||
npm_config_user_agent | ||
} = process.env; | ||
function getDonateURL() { | ||
let donate_url = npm_package_collective_url; | ||
if (npm_package_collective_suggested_donation_amount) { | ||
donate_url += `/donate/${npm_package_collective_suggested_donation_amount}`; | ||
if (npm_package_collective_suggested_donation_interval) { | ||
donate_url += `/${npm_package_collective_suggested_donation_interval}`; | ||
} | ||
donate_url += (npm_config_user_agent.match(/yarn/)) ? '/yarn' : '/npm'; | ||
} | ||
return donate_url; | ||
} | ||
const print = function(str, opts = { color: null, align: 'center'}) { | ||
@@ -7,0 +27,0 @@ opts.align = opts.align || 'center'; |
{ | ||
"name": "opencollective-postinstall", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Prompt users to donate after they install your node module with npm install", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -60,3 +60,3 @@ const fs = require('fs'); | ||
let postinstall = "./node_modules/.bin/opencollective-postinstall"; | ||
if (package.scripts.postinstall) { | ||
if (package.scripts.postinstall && package.scripts.postinstall.indexOf(postinstall) === -1) { | ||
package.scripts.postinstall = `${package.scripts.postinstall} && ${postinstall}`; | ||
@@ -63,0 +63,0 @@ } else { |
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
13624
237
3
6