Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IFS_OLD=$IFS; IFS=$'\n'
- echo -n "Backing-up file permissions ... "
- DIRS=()
- for FILE in `git ls-files`
- do
- # Save the permissions of all files in the index
- echo $FILE";"`stat -c "%a;%U;%G" $FILE` >> $DATABASE
- FILE_DIR=$(dirname "$FILE")
- if ! [[ " ${DIRS[@]} " =~ " ${FILE_DIR} " ]]; then
- DIRS+=("$FILE_DIR");
- fi
- done
- echo -n "and directory permissions ... "
- for DIR in "${DIRS[@]}"
- do
- # Save the permissions of all directories in the index
- echo $DIR";"`stat -c "%a;%U;%G" $DIR` >> $DATABASE
- done
- IFS=$IFS_OLD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement