1
0
mirror of https://github.com/AquaMorph/dotfiles.git synced 2025-05-20 17:07:00 +00:00

Root skipping flag

This commit is contained in:
Christian Colglazier 2019-12-23 13:56:04 -05:00
parent 2362602ed5
commit d0a24b844c

@ -8,6 +8,15 @@ files=($dotdir/.zshrc ~/ 'n'
$dotdir/g13 ~/.config/ 'n'
$dotdir/scripts ~/.config/ 'n')
# arg parser
for arg in "$@"
do
# Skip commands that need root access
if [[ $arg == *"-nr"* ]]; then
noRoot=true
fi
done
echo Setting up dotfiles...
# Loop through config files
@ -15,6 +24,10 @@ for (( i=0; i<${#files[@]} ; i+=3 )) ; do
# Check if sudo is needed
pre=''
if [[ ${files[i+2]} == *'y'* ]]; then
if [ $noRoot ]; then
echo Skipping ${files[i]} because root is required
continue
fi
pre='sudo'
fi