feat: Brewfile highlighting

docs: update README.md
This commit is contained in:
Chen Asraf
2023-05-29 01:30:30 +03:00
parent aef9e78895
commit 56e3a41f00
4 changed files with 34 additions and 77 deletions

View File

@@ -36,7 +36,7 @@ home() {
reload-zsh
fi
;;
reload-term | rt)
reload-term(inal)? | rt)
reload-zsh
return 0
;;
@@ -47,35 +47,35 @@ home() {
install | i)
source $DOTFILES/install.sh
;;
# dropzone | dz)
# shift
# dz_lib="$HOME/Library/Application Support/Dropzone"
# dz_bak="$DOTFILES/synced/Dropzone"
# sub="$1"
dropzone | dz)
shift
dz_lib="$HOME/Library/Application Support/Dropzone"
dz_bak="$DOTFILES/synced/Dropzone"
sub="$1"
# case $sub in
# r | restore)
# echo_cyan "Restoring Dropzone backup..."
# src="$dz_bak"
# target="$dz"
# mkdir -p $target
# cp -r $src/* $target
# ;;
# d | dump)
# echo_cyan "Creating Dropzone backup..."
# target="$dz_bak"
# src="$dz"
# rm -rf $target
# mkdir -p $target
# cp -r $src/* $target
# ;;
# *) # unknown option
# echo_red "No command or invalid command supplied."
# __home_print_help 0
# return 1
# ;;
# esac
# ;;
case $sub in
r | restore)
echo_cyan "Restoring Dropzone backup..."
src="$dz_bak"
target="$dz"
mkdir -p $target
rsync -tvr --exclude ".git" --exclude "node_modules" --no-links $src/* $target
;;
d | dump)
echo_cyan "Creating Dropzone backup..."
target="$dz_bak"
src="$dz"
rm -rf $target
mkdir -p $target
rsync -tvr --exclude ".git" --exclude "node_modules" --no-links $src/* $target
;;
*) # unknown option
echo_red "No command or invalid command supplied."
__home_print_help 0
return 1
;;
esac
;;
workflows | w)
shift
__home_prepare_dir
@@ -107,43 +107,6 @@ home() {
;;
esac
;;
motd | m)
shift
sub="$1"
case $sub in
edit | e)
if [[ "$2" == "head" ]]; then
vim $DOTFILES/synced/motd/motd.head && home motd restore
return 0
else
vim $DOTFILES/synced/motd/motd && home motd restore
fi
;;
dump | d)
echo_cyan "Creating motd backup..."
cat /etc/motd.head >$DOTFILES/synced/motd/motd.head
cat /etc/motd >$DOTFILES/synced/motd/motd
;;
restore | r)
echo_cyan "Restoring motd backup..."
cat $DOTFILES/synced/motd/motd >/etc/motd
cat $DOTFILES/synced/motd/motd.head >/etc/motd.head
if [[ "$?" -ne 0 ]]; then
echo_red "Failed to restore motd. Trying to fix permissions... needs root access"
sudo chmod 0766 /etc/motd
sudo chmod 0766 /etc/motd.head
fi
scp $DOTFILES/synced/motd/09-head root@spider.casraf.dev:/etc/update-motd.d/09-head
ssh root@spider.casraf.dev "chmod 0755 /etc/update-motd.d/09-head"
scp /etc/motd.head root@spider.casraf.dev:/etc/motd.head
scp /etc/motd root@spider.casraf.dev:/etc/motd
;;
*)
lolcat /etc/motd.head
cat /etc/motd
;;
esac
;;
help | -h | h)
shift
__home_print_help $@