Move install.sh to update.sh
This commit is contained in:
48
update.sh
Executable file
48
update.sh
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
files=".config/fish \
|
||||
.config/git \
|
||||
.config/omf \
|
||||
.config/starship.toml \
|
||||
.local/share/omf \
|
||||
.emacs \
|
||||
.tmux.conf.local"
|
||||
|
||||
|
||||
function this_script_root_dir() {
|
||||
dirname $(realpath ${BASH_SOURCE[0]})
|
||||
}
|
||||
|
||||
function run() {
|
||||
echo "$@"
|
||||
$@
|
||||
}
|
||||
|
||||
function load_gnome_terminal_profiles() {
|
||||
run dconf load /org/gnome/terminal/legacy/profiles:/ < $(this_script_root_dir)/gnome-terminal-profiles.dconf
|
||||
}
|
||||
|
||||
function install_home() {
|
||||
for f in $files
|
||||
do
|
||||
run rm -Rf $HOME/$f
|
||||
dir=$(dirname $f)
|
||||
if [ ! "$dir" = "." ]
|
||||
then
|
||||
run mkdir -p $HOME/$dir
|
||||
fi
|
||||
run ln -sf $(this_script_root_dir)/$f $HOME/$f
|
||||
done
|
||||
run ln -sf $(this_script_root_dir)/.tmux/.tmux.conf $HOME/.tmux.conf
|
||||
load_gnome_terminal_profiles
|
||||
}
|
||||
|
||||
|
||||
pushd $(this_script_root_dir)
|
||||
git pull
|
||||
git submodule init
|
||||
git submodule update
|
||||
popd
|
||||
install_home
|
||||
Reference in New Issue
Block a user