Sha256: b0df3481b0d38f47f4ac264878e44ccb7ca8164a7e2d2ce12f1a45f2466a17f2

Contents?: true

Size: 454 Bytes

Versions: 14

Compression:

Stored size: 454 Bytes

Contents

require 'bake/modernize'

def git
	update(root: Dir.pwd)
end

def update(root:)
	if current_branch != "main"
		# https://github.com/github/renaming
		system("git", "branch", "-M", "main")
		system("git", "push", "-u", "origin", "main")
	end
end

private

def current_branch
	require 'open3'
	
	output, status = Open3.capture2("git", "branch", "--show-current")
	
	unless status.success?
		raise "Could not get current branch!"
	end
	
	return output
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
bake-modernize-0.12.2 bake/modernize/git.rb
bake-modernize-0.12.1 bake/modernize/git.rb
bake-modernize-0.12.0 bake/modernize/git.rb
bake-modernize-0.11.0 bake/modernize/git.rb
bake-modernize-0.10.1 bake/modernize/git.rb
bake-modernize-0.10.0 bake/modernize/git.rb
bake-modernize-0.9.1 bake/modernize/git.rb
bake-modernize-0.8.2 bake/modernize/git.rb
bake-modernize-0.8.1 bake/modernize/git.rb
bake-modernize-0.8.0 bake/modernize/git.rb
bake-modernize-0.7.0 bake/modernize/git.rb
bake-modernize-0.6.0 bake/modernize/git.rb
bake-modernize-0.5.1 bake/modernize/git.rb
bake-modernize-0.5.0 bake/modernize/git.rb