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:
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user