From ea3fafe887fe979b922b1237b53e92057362b03e Mon Sep 17 00:00:00 2001 From: David Garcia Latorre Date: Tue, 4 Jul 2023 15:08:32 +0200 Subject: [PATCH] Ensure default branch name for dotfiles repository --- installer | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/installer b/installer index dc284abf..cd026344 100755 --- a/installer +++ b/installer @@ -71,6 +71,8 @@ DOTFILES_PATH="${DOTFILES_PATH:-$HOME/.dotfiles}" DOTFILES_PATH="$(eval echo "$DOTFILES_PATH")" export DOTFILES_PATH="$DOTFILES_PATH" +DOTFILES_BRANCH=${DOTFILES_BRANCH:-main} + dotly_inner_path="modules/dotly" export DOTLY_PATH="$DOTFILES_PATH/$dotly_inner_path" @@ -140,7 +142,7 @@ if ! command_exists curl; then fi _a "Initializing your dotfiles git repository" -git init 2>&1 | _log "Initializing repository" +git init --initial-branch="$DOTFILES_BRANCH" 2>&1 | _log "Initializing repository" _a "Cloning dotly" git submodule add -b "$DOTLY_BRANCH" "https://github.com/$DOTLY_REPOSITORY.git" "$dotly_inner_path" 2>&1 | _log "Adding dotly submodule"