aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-01-06 17:31:48 +0000
committerEgor Tensin <Egor.Tensin@gmail.com>2022-01-06 17:31:48 +0000
commit1b0e7de26eac6cee94dc1c15c8fb91e6a925bd2d (patch)
tree50781b37ab78421cb2aba62703a4fd019207e8bf /src
parentdebian: 1.1-2 (diff)
parentlinks-chmod: mode parameter is mandatory (diff)
downloadconfig-links-1b0e7de26eac6cee94dc1c15c8fb91e6a925bd2d.tar.gz
config-links-1b0e7de26eac6cee94dc1c15c8fb91e6a925bd2d.zip
Merge tag 'v2.0' into debian
Diffstat (limited to '')
-rw-r--r--src/db.sh19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/db.sh b/src/db.sh
index 5eb1697..b057202 100644
--- a/src/db.sh
+++ b/src/db.sh
@@ -263,6 +263,23 @@ unlink_obsolete_entries() {
done
}
+parse_mode() {
+ if [ "$#" -ne 1 ]; then
+ echo "usage: ${FUNCNAME[0]} MODE" >&2
+ return 1
+ fi
+
+ local mode="$1"
+ shift
+
+ if [ -z "$mode" ]; then
+ dump "mode cannot be empty" >&2
+ return 1
+ fi
+
+ echo "$mode"
+}
+
chmod_entries() {
if [ "$#" -ne 1 ]; then
echo "usage: ${FUNCNAME[0]} MODE" >&2
@@ -272,7 +289,7 @@ chmod_entries() {
local mode="$1"
shift
- echo "Applying mode $mode to shared files..."
+ dump "applying mode $mode to shared files..."
if [ "${#shared_paths[@]}" -ne 0 ]; then
is_dry_run || chmod -- "$mode" ${shared_paths[@]+"${shared_paths[@]}"}
fi