Skip to content

Commit f0aaddc

Browse files
committed
[update] : Detect working directory from configuration file
1 parent 40524b9 commit f0aaddc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tools/clean.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@ work_dir="${script_path}/work"
55
debug=false
66
only_work=false
77

8+
9+
# 設定ファイルを読み込む
10+
# load_config [file1] [file2] ...
11+
load_config() {
12+
local _file
13+
for _file in ${@}; do
14+
if [[ -f "${_file}" ]]; then
15+
source "${_file}"
16+
fi
17+
done
18+
}
19+
20+
work_dir="$(
21+
load_config "${script_path}/default.conf"
22+
load_config "${script_path}/custom.conf"
23+
cd "${script_path}"
24+
echo "$(realpath "${work_dir}")"
25+
)"
26+
27+
828
# Show an INFO message
929
# $1: message string
1030
msg_info() {

0 commit comments

Comments
 (0)