diff options
| author | Sylvain Herlédan <sylvain.herledan@hrafnagud.info> | 2017-06-03 12:52:03 +0200 |
|---|---|---|
| committer | Sylvain Herlédan <sylvain.herledan@hrafnagud.info> | 2017-06-03 12:52:03 +0200 |
| commit | e33ad4f128fb8fef2119cf2c71371eaf9c19bd29 (patch) | |
| tree | 1fe625b20799889724aad507b8bac0a77258b9ca /lib/functions.sh | |
| download | dotfiles-e33ad4f128fb8fef2119cf2c71371eaf9c19bd29.tar.gz dotfiles-e33ad4f128fb8fef2119cf2c71371eaf9c19bd29.tar.bz2 dotfiles-e33ad4f128fb8fef2119cf2c71371eaf9c19bd29.zip | |
Initial setup with basic tools: vim/dein, tmux, st, tup, X
Diffstat (limited to 'lib/functions.sh')
| -rw-r--r-- | lib/functions.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/functions.sh b/lib/functions.sh new file mode 100644 index 0000000..99a8962 --- /dev/null +++ b/lib/functions.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +function has() +{ + local command_name="${1}"; shift; + + set +o errexit + hash "${command_name}" > /dev/null 2>&1; + if [ 0 -eq ${?} ]; + then + set -o errexit + return 0; + fi + + set -o errexit + return 1; +} + |
