bass.fish 658 B

1234567891011121314151617181920212223242526272829
  1. function bass
  2. set -l bash_args $argv
  3. set -l bass_debug
  4. if test "$bash_args[1]_" = '-d_'
  5. set bass_debug true
  6. set -e bash_args[1]
  7. end
  8. set -l script_file (mktemp)
  9. if command -v python3 >/dev/null 2>&1
  10. command python3 -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file
  11. else
  12. command python -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file
  13. end
  14. set -l bass_status $status
  15. if test $bass_status -ne 0
  16. return $bass_status
  17. end
  18. if test -n "$bass_debug"
  19. cat $script_file
  20. end
  21. source $script_file
  22. command rm $script_file
  23. end
  24. function __bass_usage
  25. echo "Usage: bass [-d] <bash-command>"
  26. end