Skip to content

Commit e9010e2

Browse files
authored
feat: ensure default branch name for dotfiles repository (#242)
1 parent 0065368 commit e9010e2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

installer

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ DOTFILES_PATH="${DOTFILES_PATH:-$HOME/.dotfiles}"
7171
DOTFILES_PATH="$(eval echo "$DOTFILES_PATH")"
7272
export DOTFILES_PATH="$DOTFILES_PATH"
7373

74+
DOTFILES_BRANCH=${DOTFILES_BRANCH:-main}
75+
7476
dotly_inner_path="modules/dotly"
7577
export DOTLY_PATH="$DOTFILES_PATH/$dotly_inner_path"
7678

@@ -140,7 +142,7 @@ if ! command_exists curl; then
140142
fi
141143

142144
_a "Initializing your dotfiles git repository"
143-
git init 2>&1 | _log "Initializing repository"
145+
git init --initial-branch="$DOTFILES_BRANCH" 2>&1 | _log "Initializing repository"
144146

145147
_a "Cloning dotly"
146148
git submodule add -b "$DOTLY_BRANCH" "https://github.com/$DOTLY_REPOSITORY.git" "$dotly_inner_path" 2>&1 | _log "Adding dotly submodule"

0 commit comments

Comments
 (0)