aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/pre.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2012-11-28 20:14:05 -0800
committerelijah <elijah@riseup.net>2012-11-28 20:14:05 -0800
commite5ed1ba2df6f735e32de35d9171d572dce322b7f (patch)
tree1a9120599adc7215edee5cf36ef27511823dd819 /lib/leap_cli/commands/pre.rb
parente2c31618b6f70d86c55c348436dd600b2e4ace21 (diff)
downloadleap_cli-e5ed1ba2df6f735e32de35d9171d572dce322b7f.tar.gz
leap_cli-e5ed1ba2df6f735e32de35d9171d572dce322b7f.tar.bz2
new system for how directory paths work. now there is a file Leapfile that manages this, instead of it always being ../leap_platform
Diffstat (limited to 'lib/leap_cli/commands/pre.rb')
-rw-r--r--lib/leap_cli/commands/pre.rb24
1 files changed, 10 insertions, 14 deletions
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
#