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

Add shebang in bin script #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ymtszw
Copy link

@ymtszw ymtszw commented Jan 12, 2018

Currently, package.json states:

  "bin": {
    "local-dynamo": "./bin/launch_local_dynamo.js"
  }

So npm install local-dynamo in user's project will generates node_modules/.bin/local-dynamo file with contents of bin/launch_local_dynamo.js.

Though bin/launch_local_dynamo.js currently does not have shebang so executing it directly from shells or via npm run will cause syntax error.

This PR adds it so now you can do these from user's project:

$ npm install local-dynamo
$ node_modules/.bin/local-dynamo
Initializing DynamoDB Local with the following configuration:
Port:	4567
InMemory:	true
DbPath:	null
SharedDb:	false
shouldDelayTransientStatuses:	false
CorsParams:	*
# With npm-scripts in package.json like this
# "scripts": {
#   "dynamo": "local-dynamo"
# }
$ npm run dynamo
Initializing DynamoDB Local with the following configuration:
Port:	4567
InMemory:	true
DbPath:	null
SharedDb:	false
shouldDelayTransientStatuses:	false
CorsParams:	*

Also, node binary can handle shebang in passed script, so usage example in README.md should keep working.

$ node bin/launch_local_dynamo.js
Initializing DynamoDB Local with the following configuration:
Port:	4567
InMemory:	true
DbPath:	null
SharedDb:	false
shouldDelayTransientStatuses:	false
CorsParams:	*

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

Successfully merging this pull request may close these issues.

1 participant