summaryrefslogtreecommitdiff
path: root/lib/chef/knife
diff options
context:
space:
mode:
authorVivek Singh <vivek.singh@msystechnologies.com>2019-10-29 00:24:18 +0530
committerVivek Singh <vivek.singh@msystechnologies.com>2019-10-29 00:24:18 +0530
commitb3ec36bf24c462c1505f1e63ae2561ea809c4402 (patch)
tree375f6071e57161892ff7429d8ec19920da74c644 /lib/chef/knife
parentd0908f4555b436eb74bbfee1a050a7cc84550aed (diff)
downloadchef-b3ec36bf24c462c1505f1e63ae2561ea809c4402.tar.gz
Fix knife cookbook metadata from file name args
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Diffstat (limited to 'lib/chef/knife')
-rw-r--r--lib/chef/knife/cookbook_metadata_from_file.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/chef/knife/cookbook_metadata_from_file.rb b/lib/chef/knife/cookbook_metadata_from_file.rb
index 62d0f24324..42f8acba56 100644
--- a/lib/chef/knife/cookbook_metadata_from_file.rb
+++ b/lib/chef/knife/cookbook_metadata_from_file.rb
@@ -31,6 +31,12 @@ class Chef
banner "knife cookbook metadata from file FILE (options)"
def run
+ if @name_args.length < 1
+ show_usage
+ ui.fatal("You must specify the FILE.")
+ exit(1)
+ end
+
file = @name_args[0]
cookbook = File.basename(File.dirname(file))