Skip to content

Instantly share code, notes, and snippets.

@d12frosted
Last active April 6, 2021 06:38
Show Gist options
  • Save d12frosted/b150fcaaf2de06b1b29af487ebbbf9c1 to your computer and use it in GitHub Desktop.
Save d12frosted/b150fcaaf2de06b1b29af487ebbbf9c1 to your computer and use it in GitHub Desktop.
#!/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