Skip to content

Commit d0b2459

Browse files
committed
Fix issue where no modifications fails the release
1 parent 3159645 commit d0b2459

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

Rakefile

+14-10
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,21 @@ namespace :release do
7575
content = site_menu.read.lines
7676
content.delete_if { |line| line.match?(/^\s+prior:/) }
7777
site_menu.write(content.join)
78+
site_menu_modified = !`git status --porcelain _data/site_menu.yml`.chomp.empty?
7879

7980
# Commit
80-
files_to_update = [site_menu]
81-
exit $?.exitstatus unless system("git add #{files_to_update.join(" ")}")
82-
exit $?.exitstatus unless system("git commit -m 'Changes after new branch #{branch}'")
83-
84-
puts
85-
puts "The commit on #{current_branch} has been created."
86-
puts "Run the following to push to the upstream remote:"
87-
puts
88-
puts "\tgit push upstream #{current_branch}"
89-
puts
81+
files_to_update = []
82+
files_to_update << site_menu if site_menu_modified
83+
if files_to_update.any?
84+
exit $?.exitstatus unless system("git add #{files_to_update.join(" ")}")
85+
exit $?.exitstatus unless system("git commit -m 'Changes after new branch #{branch}'")
86+
87+
puts
88+
puts "The commit on #{current_branch} has been created."
89+
puts "Run the following to push to the upstream remote:"
90+
puts
91+
puts "\tgit push upstream #{current_branch}"
92+
puts
93+
end
9094
end
9195
end

0 commit comments

Comments
 (0)