mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +00:00
set @mutated in the right place
This commit is contained in:
parent
8d0036ddb0
commit
7572b2917f
1 changed files with 3 additions and 3 deletions
|
|
@ -239,7 +239,6 @@ class HarpBlog
|
||||||
begin
|
begin
|
||||||
write_post(post)
|
write_post(post)
|
||||||
git_commit(action, post.title, post_path(post.dir))
|
git_commit(action, post.title, post_path(post.dir))
|
||||||
@mutated = true
|
|
||||||
post
|
post
|
||||||
|
|
||||||
rescue => e
|
rescue => e
|
||||||
|
|
@ -256,7 +255,6 @@ class HarpBlog
|
||||||
delete_post_body(post_dir, id)
|
delete_post_body(post_dir, id)
|
||||||
delete_post_index(post_dir, id)
|
delete_post_index(post_dir, id)
|
||||||
git_commit('delete', id, post_dir)
|
git_commit('delete', id, post_dir)
|
||||||
@mutated = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def write_post(post)
|
def write_post(post)
|
||||||
|
|
@ -392,7 +390,9 @@ class HarpBlog
|
||||||
def git_commit(action, title, *files)
|
def git_commit(action, title, *files)
|
||||||
quoted_files = files.map { |f| "\"#{quote(f)}\"" }
|
quoted_files = files.map { |f| "\"#{quote(f)}\"" }
|
||||||
message = "#{action} '#{quote(title || 'Untitled')}'"
|
message = "#{action} '#{quote(title || 'Untitled')}'"
|
||||||
run("git add -A #{quoted_files.join(' ')} && git commit -m \"#{message}\"")
|
success, _ = run("git add -A #{quoted_files.join(' ')} && git commit -m \"#{message}\"")
|
||||||
|
@mutated = true if success
|
||||||
|
success
|
||||||
end
|
end
|
||||||
|
|
||||||
def git_reset_hard(ref = nil)
|
def git_reset_hard(ref = nil)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue