This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #244 from nearprotocol/fix-bin
Use flagged-respawn to respawn Node.js cleanly for `near repl`
- Loading branch information
Showing
3 changed files
with
45 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.