2019.5.6 • Published 5 years ago

mac-terminal-interpreter v2019.5.6

Weekly downloads
-
License
Unlicense
Repository
-
Last release
5 years ago

npm.io

macOS volume

Installation

$ [sudo] npm i -g mac-terminal-interpreter

Benefits

  • opens in the Terminal.app even without .command extension
  • stdout, stderr logs
  • makes .command file executable
  • window closure options (doesn't close, close if the shell exited cleanly, close always,)
  • displayed non-zero exit status
  • bell notification on error

How it works

script.ext

#!/usr/bin/env terminal
...

stdout, stderr logs:

~/Library/Logs/<slug>/<date>/out.log
~/Library/Logs/<slug>/<date>/err.log

Config

~/.bashrc:

export MAC_TERMINAL_CLOSE=0 # doesn't close (default)
export MAC_TERMINAL_CLOSE=1 # close if the shell exited cleanly
export MAC_TERMINAL_CLOSE=2 # close always

Terminal error sound:

$ defaults write .GlobalPreferences com.apple.sound.beep.sound /System/Library/Sounds/Basso.aiff

Scripts usage

commandusage
terminalusage: terminal path