aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/path.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-02-08 23:09:47 -0800
committerelijah <elijah@riseup.net>2013-02-08 23:09:47 -0800
commit882a019ce26a045d445c38bdc0f348588a30f465 (patch)
tree5d2ee4ee792376a0f2ebb305a80e74f75e0f4d03 /lib/leap_cli/path.rb
parent6e5289b7df7ff2f1320ba139303018d260c9b9cf (diff)
downloadleap_cli-882a019ce26a045d445c38bdc0f348588a30f465.tar.gz
leap_cli-882a019ce26a045d445c38bdc0f348588a30f465.tar.bz2
changed `leap init` to `leap new`, made more foolproof.
Diffstat (limited to 'lib/leap_cli/path.rb')
-rw-r--r--lib/leap_cli/path.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/leap_cli/path.rb b/lib/leap_cli/path.rb
index 7628628..634284d 100644
--- a/lib/leap_cli/path.rb
+++ b/lib/leap_cli/path.rb
@@ -135,8 +135,12 @@ module LeapCli; module Path
end
def self.relative_path(path, provider_dir=Path.provider)
- path = named_path(path, provider_dir)
- path.sub(/^#{Regexp.escape(provider_dir)}\//,'')
+ if provider_dir
+ path = named_path(path, provider_dir)
+ path.sub(/^#{Regexp.escape(provider_dir)}\//,'')
+ else
+ path
+ end
end
end; end