New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(autoinstall): Add disabling of autoinstall globally via environm… #2152

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@cacheflow
Copy link

cacheflow commented Oct 16, 2018

↪️ Pull Request

-Allow disabling of autoinstall via a environment variable named PARCEL_AUTOINSTALL.

✔️ PR Todo

  • [x ] Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • [ x] Included links to related issues/PRs

Feature Request: #2081

@cacheflow cacheflow force-pushed the cacheflow:disable-autoinstall-globally-via-env-var branch from b3daf7f to 644170a Oct 16, 2018

@@ -135,7 +135,8 @@ class Bundler extends EventEmitter {
detailedReport: options.detailedReport || false,
global: options.global,
autoinstall:
typeof options.autoinstall === 'boolean'
typeof options.autoinstall === 'boolean' &&
process.env.PARCEL_AUTOINSTALL !== 'false'

This comment has been minimized.

@devongovett

devongovett Oct 17, 2018

Member

I think the local autoinstall option should override the environment variable. The environment variable should only apply if the option is not set.

@cacheflow cacheflow force-pushed the cacheflow:disable-autoinstall-globally-via-env-var branch 2 times, most recently from caa6a36 to 10cfca9 Oct 18, 2018

const autoInstall =
typeof options.autoinstall === 'boolean'
? options.autoinstall
: typeof process.env.PARCEL_AUTOINSTALL === 'boolean'

This comment has been minimized.

@devongovett

devongovett Oct 18, 2018

Member

does that actually get converted to a boolean if you provide this environment variable from a terminal?

This comment has been minimized.

@cacheflow

cacheflow Oct 30, 2018

Author

It does not, so I've updated the check.

@cacheflow cacheflow force-pushed the cacheflow:disable-autoinstall-globally-via-env-var branch 2 times, most recently from 4025729 to 856764c Oct 23, 2018

@cacheflow cacheflow force-pushed the cacheflow:disable-autoinstall-globally-via-env-var branch from 856764c to 47b998f Oct 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment