Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #244 from nearprotocol/fix-bin
Browse files Browse the repository at this point in the history
Use flagged-respawn to respawn Node.js cleanly for `near repl`
  • Loading branch information
vgrichina authored Jan 16, 2020
2 parents f0c80f1 + 8e261ff commit 6984a29
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 13 deletions.
15 changes: 11 additions & 4 deletions bin/near
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/sh
CLI_PATH="$(dirname "$0")"/near-cli.js
node --experimental-repl-await "$CLI_PATH" "$@"

#!/usr/bin/env node
const flaggedRespawn = require('flagged-respawn');
require('v8flags')((e, flags) => {
if (e) {
throw e;
}
flaggedRespawn(
flags.concat(['--experimental_repl_await']),
process.argv.indexOf('repl') == -1 ? process.argv : process.argv.concat(['--experimental-repl-await']),
ready => ready && require('./near-cli.js'));
})
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "near-shell",
"version": "0.20.0",
"version": "0.20.1-preview2",
"description": "Command line utilities to interact with near blockchain",
"engines": {
"node": ">= 10"
Expand All @@ -22,8 +22,7 @@
},
"homepage": "https://github.com/nearprotocol/near-shell#readme",
"bin": {
"near": "./bin/near",
"near-cli.js": "./bin/near-cli.js"
"near": "./bin/near"
},
"devDependencies": {
"eslint": "^6.4.0",
Expand All @@ -36,12 +35,14 @@
"bn": "^1.0.5",
"bs58": "^4.0.1",
"chalk": "^3.0.0",
"flagged-respawn": "^1.0.1",
"is-ci": "^2.0.0",
"jest-environment-node": "^24.5.0",
"ncp": "^2.0.0",
"nearlib": "^0.20.0",
"rimraf": "^3.0.0",
"update-notifier": "^4.0.0",
"v8flags": "^3.1.3",
"yargs": "^15.0.1"
},
"keywords": [
Expand Down
36 changes: 30 additions & 6 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6984a29

Please sign in to comment.