From f3191e00a1d454d714a67857a79160c3d7bffbab Mon Sep 17 00:00:00 2001 From: Laurent Sansonetti Date: Tue, 3 Apr 2012 20:45:26 +0200 Subject: [PATCH] say that the product is already activated first --- bin/motion | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/motion b/bin/motion index f3452a04..1b29c9fe 100644 --- a/bin/motion +++ b/bin/motion @@ -48,6 +48,10 @@ class ActivateCommand < Command self.help = 'Activate the software license' def self.run(args) + if File.exist?(LicensePath) + die "Product is already activated. Delete the license file `#{LicensePath}' if you want to activate a new license." + end + if args.size != 1 die "Usage: motion activate " end @@ -57,10 +61,6 @@ class ActivateCommand < Command die "Given license key `#{license_key}' seems invalid. It should be a string of 40 hexadecimal characters. Check the mail you received after the order, or contact us if you need any help: info@hipbyte.com" end - if File.exist?(LicensePath) - die "Product is already activated. Delete the license file `#{LicensePath}' if you want to activate a new license." - end - need_root File.open(LicensePath, 'w') { |io| io.write license_key } puts "Product activated. Thanks for purchasing RubyMotion :-)"