SamVerschueren/alfred-link

Prevent linking in some cases

Closed this issue · 6 comments

Actually, alfred-link should only be invoked when installed globally. Because of this package, tests for alfred-ng2 or alfred-npms will break because Travis tries to execute alfred-link. What would be the best way to prevent this? Just return and do nothing when ran on Travis?

https://travis-ci.org/sindresorhus/alfred-npms/builds/155452588

Is there any way can detect whether it's being installed with the --global script in alfred-link? Might be some environment variables available.

Couldn't find anything in the docs so have to test this.

Apparently, process.env.npm_config_global is set to 'true'.

It looks like the npm_config_global env variable isn't set by yarn. Looking through their commits, they did add support for some of the npm_config_* variables but it's unclear what those are. As a workaround, I deleted yarn.lock to use npm as seen on nanoxd/alfred-pods@6eb1314

Relevant issue: yarnpkg/yarn#399

Adding a note to the README would be helpful for anyone else encountering issues when using CI and yarn.

@nanoxd Can you open a new Yarn issue about it? Their intention is to be compatible with npm, so it probably just an oversight.

Sure 😄