summaryrefslogtreecommitdiff
path: root/lib/leap_cli/path.rb
diff options
context:
space:
mode:
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