Skip to content

Commit b2f3de7

Browse files
feat: declare and export the original user path
@mmorenoregalado proposes to maintain consistency among different nodes and sessions through CodelyTV@8dc02e4 and CodelyTV#172, which generates a side-effect for users and adds a possible code smell in the future because it introduces an if-else pattern based on a condition that users may not expect. Also it doesn't allow the user to employ other environment variables, so we apply the template engine ideas and differentiate the application of Bash expansion.
1 parent 12ca79c commit b2f3de7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

installer

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ _w "~ │ 🚀 Welcome to the ${green}dotly${normal} installer! │ ~"
6767
_w " └────────────────────────────────────┘"
6868
_w
6969
_q "Where do you want your dotfiles to be located? (default ~/.dotfiles)" "DOTFILES_PATH"
70-
DOTFILES_PATH="${DOTFILES_PATH:-$HOME/.dotfiles}"
71-
DOTFILES_PATH="$(eval echo "$DOTFILES_PATH")"
70+
UNEXPANDED_DOTFILES_PATH="${DOTFILES_PATH:-\$HOME/.dotfiles}"
71+
DOTFILES_PATH="$(eval echo "$UNEXPANDED_DOTFILES_PATH")"
7272
export DOTFILES_PATH="$DOTFILES_PATH"
73+
export UNEXPANDED_DOTFILES_PATH="$UNEXPANDED_DOTFILES_PATH"
7374

7475
dotly_inner_path="modules/dotly"
7576
export DOTLY_PATH="$DOTFILES_PATH/$dotly_inner_path"

0 commit comments

Comments
 (0)