File tree 1 file changed +14
-10
lines changed
1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -75,17 +75,21 @@ namespace :release do
75
75
content = site_menu . read . lines
76
76
content . delete_if { |line | line . match? ( /^\s +prior:/ ) }
77
77
site_menu . write ( content . join )
78
+ site_menu_modified = !`git status --porcelain _data/site_menu.yml` . chomp . empty?
78
79
79
80
# 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 "\t git 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 "\t git push upstream #{ current_branch } "
92
+ puts
93
+ end
90
94
end
91
95
end
You can’t perform that action at this time.
0 commit comments