mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-09-22 00:04:55 +09:00
Add safety checks to release script
This commit is contained in:
+11
@@ -30,6 +30,17 @@ EXPORT_DEPLOY_LOCATION = "/local/app/product_releases/"
|
|||||||
|
|
||||||
abort "You must specify a version, e.g. `bin/release 1.0.0`" unless VERSION
|
abort "You must specify a version, e.g. `bin/release 1.0.0`" unless VERSION
|
||||||
|
|
||||||
|
current_branch = `git rev-parse --abbrev-ref HEAD`.strip
|
||||||
|
if current_branch != "main"
|
||||||
|
print "\e[1;33mWarning: You are on branch '#{current_branch}', not 'main'. Continue? [y/N] \e[0m"
|
||||||
|
abort "Release aborted." unless $stdin.gets.strip.downcase.chars.first == "y"
|
||||||
|
end
|
||||||
|
|
||||||
|
unless `git status --porcelain`.strip.empty?
|
||||||
|
print "\e[1;33mWarning: You have uncommitted changes. Continue? [y/N] \e[0m"
|
||||||
|
abort "Release aborted." unless $stdin.gets.strip.downcase.chars.first == "y"
|
||||||
|
end
|
||||||
|
|
||||||
def announcing(message)
|
def announcing(message)
|
||||||
puts "\n\e[1;36m#{message}\e[0m"
|
puts "\n\e[1;36m#{message}\e[0m"
|
||||||
yield
|
yield
|
||||||
|
|||||||
Reference in New Issue
Block a user