aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/common.sh
blob: c93ff8d5cf430baf965cbef92ca003504f8fad9c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright (c) 2016 Egor Tensin <egor@tensin.name>
# This file is part of the "Config 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}"
}