Skip to content
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

"postinstall": "opencollective || exit 0" reportedly fails in PowerShell #68

Open
hedgerh opened this issue Aug 12, 2021 · 0 comments
Open

Comments

@hedgerh
Copy link

hedgerh commented Aug 12, 2021

I wanted to pass this along from an issue in nestjs: nestjs/nest#7049

The setup provides this postinstall script:

"scripts": {
  "postinstall": "opencollective || exit 0"
},

According to the reporter of this issue above, that script fails on PowerShell, throwing this error:

> opencollective || exit 0

At line:1 char:16
+ opencollective || exit 0
+                ~~
The token '||' is not a valid statement separator in this version.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : InvalidEndOfLine

Because || isn't a valid operator in PowerShell. It uses something like -or/-and instead of ||/&&. As a result, they aren't able to install a project that uses nestjs v7.

I'm not sure why the || exit 0 is required, but I wonder if there's a cross-platform alternative that would work for PowerShell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant