mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-01 17:39:54 +08:00
say that the product is already activated first
This commit is contained in:
@@ -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 <license-key>"
|
||||
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 :-)"
|
||||
|
||||
Reference in New Issue
Block a user