lib/cide/cli.rb in cide-0.8.0 vs lib/cide/cli.rb in cide-0.8.1

- old
+ new

@@ -121,11 +121,11 @@ method_option 'upload', desc: 'Whenever to upload the result to S3', type: :boolean, default: true - method_option 'set-version', + method_option 'set_version', desc: 'Tells cide the package version, otherwise extracted from git', default: nil # AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_REGION need to be passed # either trough the env or ~/.aws/credentials file @@ -140,11 +140,13 @@ build_root = File.expand_path('.package') guest_export_dir = '/cide/package' host_export_dir = File.join(build_root, 'package') - version = options.version || ( + FileUtils.rm_rf(build_root) + + version = options.set_version || ( git_branch = `git symbolic-ref --short -q HEAD || echo unknown`.strip git_rev = `git rev-parse --short HEAD`.strip "#{git_branch}-#{git_rev}" ) @@ -175,11 +177,9 @@ ) runner.run! ## Export ## banner 'Export' - - FileUtils.rm_rf(build_root) runner.export!( guest_dir: guest_export_dir, host_dir: host_export_dir, )