lib/cide/cli.rb in cide-0.4.1 vs lib/cide/cli.rb in cide-0.5.0

- old
+ new

@@ -19,47 +19,47 @@ desc 'build', 'Builds an image and executes the run script' method_option 'name', desc: 'Name of the build', - aliases: %w(n t), + aliases: %w(-n -t), default: File.basename(Dir.pwd) method_option 'export', desc: 'Whenever to export artifacts', type: :boolean, default: nil method_option 'export_dir', desc: 'Change the ouput directory on the host', - aliases: %w(o host_export_dir), + aliases: %w(-o --host_export_dir), default: nil method_option 'run', desc: 'Override the script to run', type: :array, - aliases: ['r'], + aliases: ['-r'], default: [] method_option 'pull', desc: 'Whenever to pull for new images on build', type: :boolean, default: true method_option 'ssh_key', desc: 'Path to a ssh key to import into the docker image', - aliases: ['s'], + aliases: ['-s'], default: '~/.ssh/id_rsa' def build containers = [] setup_docker ## Config ## banner 'Config' - build = Build::Config.load_file CONFIG_FILE + build = Build::Config.load(Dir.pwd) exit 1 if build.nil? export_dir = options.export_dir export_dir ||= File.dirname(build.export_dir) if build.export_dir ssh_key = File.expand_path(options.ssh_key) build.run = options.run unless options.run.empty? @@ -159,11 +159,11 @@ end desc 'debug', 'Opens a debug console in the last project image' method_option 'name', desc: 'Name of the build', - aliases: %w(n t), + aliases: %w(-n -t), default: File.basename(Dir.pwd) method_option 'user', desc: 'User to run under', default: 'cide' def debug @@ -171,11 +171,11 @@ setup_docker ## Config ## banner 'Config' - build = Build::Config.load_file CONFIG_FILE + build = Build::Config.load exit 1 if build.nil? name = CIDE::Docker.id options.name tag = "cide/#{name}" say_status :config, build.inspect @@ -268,13 +268,13 @@ end docker('rmi', '--force', *old_cide_images) end - desc 'init', "Creates a blank #{CONFIG_FILE} into the project" + desc 'init', "Creates a blank #{CONFIG_FILES.first} into the project" def init - puts "Creating #{CONFIG_FILE} with default values" - create_file CONFIG_FILE, File.read(DEFAULT_CIDEFILE) + puts "Creating #{CONFIG_FILES.first} with default values" + create_file CONFIG_FILES.first, File.read(DEFAULT_CIDEFILE) end private def create_tmp_file(destination, *args, &block)