mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +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
|
||||
write_post(post)
|
||||
git_commit(action, post.title, post_path(post.dir))
|
||||
@mutated = true
|
||||
post
|
||||
|
||||
rescue => e
|
||||
|
|
@ -256,7 +255,6 @@ class HarpBlog
|
|||
delete_post_body(post_dir, id)
|
||||
delete_post_index(post_dir, id)
|
||||
git_commit('delete', id, post_dir)
|
||||
@mutated = true
|
||||
end
|
||||
|
||||
def write_post(post)
|
||||
|
|
@ -392,7 +390,9 @@ class HarpBlog
|
|||
def git_commit(action, title, *files)
|
||||
quoted_files = files.map { |f| "\"#{quote(f)}\"" }
|
||||
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
|
||||
|
||||
def git_reset_hard(ref = nil)
|
||||
|
|
|
|||
Loading…
Reference in a new issue