Last active
April 6, 2021 06:38
-
-
Save d12frosted/b150fcaaf2de06b1b29af487ebbbf9c1 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
set -e | |
ACTION=$1 | |
emacs_d=$HOME/.config/emacs | |
if [[ -d "$XDG_CONFIG_HOME" ]]; then | |
emacs_d="$XDG_CONFIG_HOME/emacs" | |
fi | |
function print_usage() { | |
echo "Usage: | |
emacs-eru ACTION | |
Actions: | |
install Install dependencies, compile and lint configurations | |
upgrade Upgrade dependencies | |
test Test configurations | |
" | |
} | |
if [ -z "$ACTION" ]; then | |
echo "No ACTION is provided" | |
print_usage | |
exit 1 | |
fi | |
case "$ACTION" in | |
install) | |
cd "$emacs_d" && { | |
make bootstrap compile lint roam | |
} | |
;; | |
upgrade) | |
cd "$emacs_d" && { | |
make upgrade compile lint | |
} | |
;; | |
test) | |
cd "$emacs_d" && { | |
make test | |
} | |
;; | |
*) | |
echo "Unrecognized ACTION $ACTION" | |
print_usage | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment