npm-run.plugin.zsh icon indicating copy to clipboard operation
npm-run.plugin.zsh copied to clipboard

Scripts with a `:`

Open mxstbr opened this issue 9 years ago • 4 comments
trafficstars

I have a few linting script for my react-boilerplate, structured like this:

"scripts": {
    "lint": "npm run lint:js && npm run lint:css",
    "lint:js": "eslint .",
    "lint:js:staged": "eslint-staged",
    "lint:css": "stylelint ./app/**/*.css",
    "lint:css:staged": "stylelint-staged",
    "lint:staged": "npm run lint:js:staged && npm run lint:css:staged"
}

When using this (otherwise amazing) plugin, I get the following instead:

screen shot 2016-02-18 at 14 21 20

Which doesn't work because the : are stripped. Any ideas why this happens and how to fix it?

Thanks for this great plugin!

mxstbr avatar Feb 18 '16 22:02 mxstbr

The same problem.

denysdovhan avatar Jun 01 '16 15:06 denysdovhan

same issue here - does not like :targets

chrisbward avatar Mar 29 '17 13:03 chrisbward

Submitted a PR that fixes this issue for me:

https://github.com/akoenig/npm-run.plugin.zsh/pull/8/files

igorprado avatar Feb 01 '18 21:02 igorprado

If you don't mind a dependency on jq, you can change line 11 to this which feels a lot more robust:

compls=$([[ -s $PWD/package.json ]] || return 0 && jq -r '.scripts | keys | sort | .[]' package.json)

bschlenk avatar Aug 19 '20 15:08 bschlenk