From 5704a6b9dda8d200248ae58bc8d960eb2e3926d9 Mon Sep 17 00:00:00 2001 From: Joffrey Jaffeux Date: Fri, 16 Aug 2013 22:37:34 +0200 Subject: [PATCH] Check if /Library/RubyMotion.old already exists --- lib/motion/project/command/update.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/motion/project/command/update.rb b/lib/motion/project/command/update.rb index 79679512..e95546f4 100644 --- a/lib/motion/project/command/update.rb +++ b/lib/motion/project/command/update.rb @@ -44,6 +44,7 @@ module Motion; module Project when '--check' check_mode = true when /--cache-version=(.+)/ + die("/Library/RubyMotion.old already exists, please move this directory before using --cache-version") if File.exist?('/Library/RubyMotion.old') wanted_software_version = $1.to_s when /--force-version=(.+)/ die "–-force-version has been removed in favor of –-cache-version" @@ -121,7 +122,7 @@ module Motion; module Project FileUtils.rm_rf Motion::Project::Builder.common_build_dir ensure - if File.exist?('/Library/RubyMotion.old') + if wanted_software_version && File.exist?('/Library/RubyMotion.old') FileUtils.mv '/Library/RubyMotion.old', '/Library/RubyMotion' end end