1
0
Fork 0

bootstrap: implement directories.txt validation

This commit is contained in:
Luca Bilke 2024-06-12 13:12:51 +02:00
parent 585fe39d7b
commit 50abed2750
No known key found for this signature in database
GPG Key ID: B753481DA0B6FA47
1 changed files with 4 additions and 0 deletions

View File

@ -146,10 +146,14 @@ create_directories() {
_loop_wrapper "${SCRIPT_DIR}/directories.txt" \
'Creating directory $(echo $x | cut -d"," -f1)' \
'
set -e
dir=$(echo $x | cut -d"," -f1)
mod=$(echo $x | cut -d"," -f2)
[ "$dir" = "$mod" ] && mod="755"
[ -d "${user_home}/${dir}" ] || mkdir -p "${user_home}/${dir}"
sudo -u "$username" mkdir -p "${user_home}/${dir}"
chmod "${mod}" "${user_home}/${dir}"
set +e
'
info "Done!"
}