Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Just an idea for now. Not used anywhere.
- Loading branch information
Andy Chu
committed
Jul 27, 2019
1 parent
3e4a97f
commit 1855f5c
Showing
2 changed files
with
36 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# oil-polyfill.sh | ||
# | ||
# Portable shell for some of Oil's builtins. | ||
# | ||
# Usage: | ||
# source oil-polyfill.sh | ||
# | ||
# TODO: Where to deploy this? I think we want versioned copies in | ||
# ~/.local/lib/oil-0.7.0/stdlib/oil-polyfill.sh | ||
|
||
sh-strict() { | ||
### Turn on "legacy" shell strict modes. | ||
|
||
# bash has this option, which is similar. | ||
# use || true in case | ||
# Actually we don't need this because of static-word-eval subsumes it? | ||
#shopt -s nullglob 2>/dev/null || true | ||
|
||
# POSIX | ||
set -o errexit -o nounset -o pipefail | ||
} | ||
|
||
log() { | ||
### Write a message to stderr. | ||
echo "$@" 1>&2 | ||
} | ||
|
||
die() { | ||
### Write a message to stderr and exit failure. | ||
log 'fatal:' "$@" | ||
exit 1 | ||
} | ||
|