22 lines
540 B
Bash
22 lines
540 B
Bash
#!/usr/bin/env bash
|
|
|
|
HOSTNAME=`emacs --batch --eval '(message "%s" (system-name))' 2>&1`
|
|
|
|
ROOT_DIR="$(cd $(dirname $0)/../ && pwd -P)"
|
|
CACHE_DIR="$ROOT_DIR/private/cache/$HOSTNAME"
|
|
ELPA_DIR="$ROOT_DIR/.cask/`emacs --version | grep -E -o '2[4-9]\.[0-9\.]+'`/elpa"
|
|
EXT_DIR="$ROOT_DIR/ext"
|
|
|
|
#
|
|
is-arch() { [ -f "/etc/arch-release" ]; }
|
|
is-deb() { [ -f "/etc/debian_version" ]; }
|
|
|
|
git-repo() {
|
|
old=$(pwd)
|
|
if [ -d "$2" ]; then
|
|
cd "$2" && git pull
|
|
else
|
|
git clone --depth 1 --recursive "$1" "$2"
|
|
fi
|
|
cd "$old"
|
|
}
|