diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2022-01-06 17:31:48 +0000 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2022-01-06 17:31:48 +0000 |
commit | 1b0e7de26eac6cee94dc1c15c8fb91e6a925bd2d (patch) | |
tree | 50781b37ab78421cb2aba62703a4fd019207e8bf /src | |
parent | debian: 1.1-2 (diff) | |
parent | links-chmod: mode parameter is mandatory (diff) | |
download | config-links-1b0e7de26eac6cee94dc1c15c8fb91e6a925bd2d.tar.gz config-links-1b0e7de26eac6cee94dc1c15c8fb91e6a925bd2d.zip |
Merge tag 'v2.0' into debian
Diffstat (limited to 'src')
-rw-r--r-- | src/db.sh | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -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 |