Created
December 13, 2019 08:52
-
-
Save thejhh/71a4acbcb9919f89cde7c7d1bc7589e2 to your computer and use it in GitHub Desktop.
Example of executing a NodeJS script with custom environment variables on all systems (supports both node and nodejs names for the executable)
This file contains hidden or 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
| #!/bin/bash | |
| ':' //; export TERMINAL_COLS="$(tput cols)" | |
| ':' //; exec "$(command -v nodejs || command -v node)" -- "$0" "$@" | |
| const TERMINAL_COLS = parseInt(process.env.TERMINAL_COLS, 10); | |
| console.log(TERMINAL_COLS); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment