mirror of
https://github.com/AquaMorph/dotfiles.git
synced 2025-04-30 01:35:34 +00:00
Install script uses functions
This commit is contained in:
parent
8550832516
commit
c0ae64ccfb
@ -24,10 +24,26 @@ do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo Setting up dotfiles...
|
# Check emacs setup
|
||||||
|
function emacs {
|
||||||
|
if ! [ -d ~/.emacs.d ]; then
|
||||||
|
echo Installing emacs config
|
||||||
|
cd ~
|
||||||
|
git clone git@github.com:AquaMorph/.emacs.d.git
|
||||||
|
else
|
||||||
|
echo Checking for emacs config updates
|
||||||
|
cd ~/.emacs.d
|
||||||
|
git pull
|
||||||
|
fi
|
||||||
|
|
||||||
# Loop through config files
|
}
|
||||||
for (( i=0; i<${#files[@]} ; i+=3 )) ; do
|
|
||||||
|
# Check managed dotfiles
|
||||||
|
function dotfiles {
|
||||||
|
echo Setting up dotfiles...
|
||||||
|
|
||||||
|
# Loop through config files
|
||||||
|
for (( i=0; i<${#files[@]} ; i+=3 )) ; do
|
||||||
# Check if sudo is needed
|
# Check if sudo is needed
|
||||||
pre=''
|
pre=''
|
||||||
if [[ ${files[i+2]} == *'y'* ]]; then
|
if [[ ${files[i+2]} == *'y'* ]]; then
|
||||||
@ -57,4 +73,8 @@ for (( i=0; i<${#files[@]} ; i+=3 )) ; do
|
|||||||
fi
|
fi
|
||||||
echo Creating symbolic link from ${files[i]} to ${files[i+1]}
|
echo Creating symbolic link from ${files[i]} to ${files[i+1]}
|
||||||
$pre ln -sf ${files[i]} ${files[i+1]}
|
$pre ln -sf ${files[i]} ${files[i+1]}
|
||||||
done
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
dotfiles
|
||||||
|
emacs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user