From e5ed1ba2df6f735e32de35d9171d572dce322b7f Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 28 Nov 2012 20:14:05 -0800 Subject: new system for how directory paths work. now there is a file Leapfile that manages this, instead of it always being ../leap_platform --- lib/leap_cli/commands/pre.rb | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'lib/leap_cli/commands/pre.rb') diff --git a/lib/leap_cli/commands/pre.rb b/lib/leap_cli/commands/pre.rb index dce01eb..cae787e 100644 --- a/lib/leap_cli/commands/pre.rb +++ b/lib/leap_cli/commands/pre.rb @@ -10,11 +10,6 @@ module LeapCli default_value '1' flag [:v, :verbose] - desc 'Specify the root directory' - arg_name 'path' - default_value Path.root - flag [:root] - desc 'Display version number and exit' switch :version, :negatable => false @@ -30,17 +25,18 @@ module LeapCli end # - # require a root directory + # load Leapfile # - if global[:root] - Path.set_root(global[:root]) + unless LeapCli.leapfile.load + bail! { log :missing, 'Leapfile in directory tree' } end - if Path.ok? - true - else - bail! do - log :error, "- Could not find the root directory. Change current working directory or try --root" - end + Path.set_platform_path(LeapCli.leapfile.platform_directory_path) + Path.set_provider_path(LeapCli.leapfile.provider_directory_path) + if !Path.provider || !File.directory?(Path.provider) + bail! { log :missing, "provider directory '#{Path.provider}'" } + end + if !Path.platform || !File.directory?(Path.platform) + bail! { log :missing, "platform directory '#{Path.platform}'" } end # -- cgit v1.2.3