mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 13:46:41 +00:00
Update install.sh script
This commit is contained in:
29
install.sh
29
install.sh
@@ -122,20 +122,35 @@ install_dokku() {
|
|||||||
# Helper functions
|
# Helper functions
|
||||||
#
|
#
|
||||||
|
|
||||||
|
ok() {
|
||||||
|
printf "OK:\t%s\n" "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
info() {
|
||||||
|
printf "INFO:\t%s\n" "$1"
|
||||||
|
}
|
||||||
|
|
||||||
symlink() {
|
symlink() {
|
||||||
if [ ! -e "$2" ]; then
|
local source="$1"
|
||||||
echo " symlink: $2 --> $1"
|
local target="$2"
|
||||||
ln -s "$1" "$2"
|
|
||||||
|
if [ ! -e "$target" ]; then
|
||||||
|
ok "symlink: $target --> $source"
|
||||||
|
ln -s "$source" "$target"
|
||||||
else
|
else
|
||||||
echo " exists: $2"
|
info "symlink: $target exists"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
git_clone () {
|
git_clone () {
|
||||||
if [ ! -e "$2" ]; then
|
local clone_url="$1"
|
||||||
git clone "$1" "$2"
|
local target="$2"
|
||||||
|
|
||||||
|
if [ ! -e "$target" ]; then
|
||||||
|
git clone "$clone_url" "$target"
|
||||||
|
ok "git clone: $clone_url --> $target"
|
||||||
else
|
else
|
||||||
echo "[ERROR] $2 already exists"
|
info "git clone: $target already exists"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user