Skip to content

Commit 323a35d

Browse files
committed
fix: ~/.config/one.bash/one.config.bash: No such file or directory
When user invoke "one dep install" from scratch. It throw an error.
1 parent 5021b72 commit 323a35d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

bash/load-config.bash

+7-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ ONE_CONF=${ONE_CONF:-${XDG_CONFIG_HOME:-$HOME/.config}/one.bash/one.config.bash}
44
. "$ONE_DIR/deps/one_l.bash"
55

66
# shellcheck source=../one.config.default.bash
7-
[[ -f $ONE_CONF ]] && . "$ONE_CONF"
8-
9-
ONE_CONF_DIR=$(realpath "$ONE_CONF")
10-
ONE_CONF_DIR=${ONE_CONF_DIR%/*}
7+
if [[ -f $ONE_CONF ]]; then
8+
. "$ONE_CONF"
9+
ONE_CONF_DIR=$(realpath "$ONE_CONF")
10+
ONE_CONF_DIR=${ONE_CONF_DIR%/*}
11+
else
12+
ONE_CONF_DIR=${ONE_CONF%/*}
13+
fi
1114

1215
# shellcheck source=../one.config.default.bash
1316
. "$ONE_DIR/one.config.default.bash"

0 commit comments

Comments
 (0)