Skip to content

Instantly share code, notes, and snippets.

@mk-pmb
Last active November 27, 2018 00:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mk-pmb/6b281e4bce37920ab54cab1daeea5dbf to your computer and use it in GitHub Desktop.
npm script
#!/bin/bash
# -*- coding: utf-8, tab-width: 2 -*-
SPACE="${*//[^ ]/ }"
echo "####${SPACE// /#}####"
echo "## $SPACE ##"
echo "## $* ##"
echo "## $SPACE ##"
echo "####${SPACE// /#}####"
{ "name": "my-command",
"version": "0.0.1",
"bin": {
"my-command": "my_script.sh"
},
"scripts": {
"test": "my-command hello world"
}
}
/…/nodejs/modules/my-command$ npm test
> my-command@0.0.1 test /…/nodejs/modules/my-command
> my-command hello world
sh: 1: my-command: not found
~/tmp/yolo$ npm test
> yolo@0.0.1 test /…/tmp/yolo
> my-command here it works
#####################
## ##
## here it works ##
## ##
#####################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment