Skip to content

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

Open
@hedgerh

Description

@hedgerh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions