Sha256: 36d58514f4b89f214b993dc2eaec25a05bdeeb4835f72e7e0f06b9c9bff122ac

Contents?: true

Size: 453 Bytes

Versions: 44

Compression:

Stored size: 453 Bytes

Contents

# frozen_string_literal: true

module Bridgetown
  module Commands
    module GitHelpers
      def initialize_new_repo
        run "git init", abort_on_failure: true
        `git symbolic-ref HEAD refs/heads/main` if user_default_branch.empty?
      end

      def destroy_existing_repo
        run "rm -rf .git"
      end

      def user_default_branch
        @user_default_branch ||= `git config init.defaultbranch`.strip
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
bridgetown-core-2.0.0.beta3 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-2.0.0.beta2 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-2.0.0.beta1 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.3.4 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.3.3 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.3.2 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.3.1 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.3.0 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.3.0.beta3 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.3.0.beta2 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.3.0.beta1 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.2.0 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.2.0.beta5 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.2.0.beta4 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.2.0.beta3 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.2.0.beta2 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.2.0.beta1 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.1.0 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.1.0.beta3 lib/bridgetown-core/commands/concerns/git_helpers.rb
bridgetown-core-1.1.0.beta2 lib/bridgetown-core/commands/concerns/git_helpers.rb