aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/common.sh
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2019-08-07 20:45:05 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2019-08-07 20:45:05 +0300
commitd34e78f86a71523f8992453b578e3e016f572a5a (patch)
treee2331fdc5b2c7099a2fdb00b70450271c3a654fb /src/common.sh
parentsupport a dumb variable for root path / (diff)
downloadconfig-links-d34e78f86a71523f8992453b578e3e016f572a5a.tar.gz
config-links-d34e78f86a71523f8992453b578e3e016f572a5a.zip
split update.sh into multiple files
Diffstat (limited to 'src/common.sh')
-rw-r--r--src/common.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/common.sh b/src/common.sh
new file mode 100644
index 0000000..18df4ce
--- /dev/null
+++ b/src/common.sh
@@ -0,0 +1,22 @@
+# Copyright (c) 2016 Egor Tensin <Egor.Tensin@gmail.com>
+# This file is part of the "Configuration file sharing" project.
+# For details, see https://github.com/egor-tensin/config-links.
+# Distributed under the MIT License.
+
+dump() {
+ local prefix="${FUNCNAME[0]}"
+ [ "${#FUNCNAME[@]}" -gt 1 ] && prefix="${FUNCNAME[1]}"
+
+ local msg
+ for msg; do
+ echo "$prefix: $msg"
+ done
+}
+
+set_dry_run() {
+ dry_run=1
+}
+
+is_dry_run() {
+ test -n "${dry_run+x}"
+}