Adds a clean install script
This commit is contained in:
32
install.sh
Executable file
32
install.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
files=".config/fish \
|
||||
.config/git .config/omf .config/starship .tmux.conf .local/share/omf"
|
||||
|
||||
|
||||
function this_script_root_dir() {
|
||||
dirname $(realpath ${BASH_SOURCE[0]})
|
||||
}
|
||||
|
||||
function run() {
|
||||
echo "$@"
|
||||
$@
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
install_home
|
||||
Reference in New Issue
Block a user