Skip to content

Commit

Permalink
Don't risk overwriting user data unless they at least ask for it.
Browse files Browse the repository at this point in the history
  • Loading branch information
gunn committed Jan 16, 2011
1 parent b5fca40 commit 23fab1c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bin/refinerycms
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ module Refinery
puts "Use --update to replace any Refinery CMS files in an existing installation."
exit
end
if @options[:update] == true && @options[:force] == false && @app_path.join('.git').directory?
# run_command('git diff --exit-code 2>&1')
`git diff --exit-code 2>&1`
if $? != 0
puts "You have uncommitted changes or untracked files. Please remove or commit them, or:"
puts "Use --force to have Refinery proceed anyway. Untracked files will be removed, and uncommitted changes may be lost."
exit
end
end
end

def update!
Expand Down

0 comments on commit 23fab1c

Please sign in to comment.