Skip to content

Commit 1f50055

Browse files
committed
feat: ignore .swp files when doing permissions check
a .swp file is a temp file created by vim. If a file is being edited by a non linuxgsm user then this could cause a permissions issue. Adding this exception to prevent this issue
1 parent fce9f65 commit 1f50055

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lgsm/modules/check_permissions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ fn_check_ownership() {
1414
fi
1515
fi
1616
if [ -d "${modulesdir}" ]; then
17-
if [ "$(find "${modulesdir}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then
17+
if [ "$(find "${modulesdir}" -not -name '*.swp' -not -user "$(whoami)" | wc -l)" -ne "0" ]; then
1818
funcownissue=1
1919
fi
2020
fi
2121
if [ -d "${serverfiles}" ]; then
22-
if [ "$(find "${serverfiles}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then
22+
if [ "$(find "${serverfiles}" -not -name '*.swp' -not -user "$(whoami)" | wc -l)" -ne "0" ]; then
2323
filesownissue=1
2424
fi
2525
fi

0 commit comments

Comments
 (0)