aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/config/object.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-02-10 18:02:14 -0800
committerelijah <elijah@riseup.net>2013-02-10 18:02:14 -0800
commitb57bd7654615aa501d1e7ad662aaabd70c11620a (patch)
tree196ed4d6be0164ef4f1a38b1013a090672acf596 /lib/leap_cli/config/object.rb
parentabff8a84454ee971f093fc6e3cd0a64bba4fbac7 (diff)
downloadleap_cli-b57bd7654615aa501d1e7ad662aaabd70c11620a.tar.gz
leap_cli-b57bd7654615aa501d1e7ad662aaabd70c11620a.tar.bz2
fix file_path so that nested files are copied correctly
Diffstat (limited to 'lib/leap_cli/config/object.rb')
-rw-r--r--lib/leap_cli/config/object.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/leap_cli/config/object.rb b/lib/leap_cli/config/object.rb
index f75bcb9..b0e3017 100644
--- a/lib/leap_cli/config/object.rb
+++ b/lib/leap_cli/config/object.rb
@@ -249,7 +249,7 @@ module LeapCli
# * the path returned by this method is absolute
# * the path stored for use later by rsync is relative to Path.provider
# * if the path does not exist locally, but exists in provider_base, then the default file from
- # provider_base is copied locally.
+ # provider_base is copied locally. this is required for rsync to work correctly.
#
def file_path(path)
if path.is_a? Symbol
@@ -257,12 +257,14 @@ module LeapCli
end
actual_path = Path.find_file(path)
if actual_path.nil?
+ Util::log 2, :missing, path
nil
else
if actual_path =~ /^#{Regexp.escape(Path.provider_base)}/
# if file is under Path.provider_base, we must copy the default file to
# to Path.provider in order for rsync to be able to sync the file.
local_provider_path = actual_path.sub(/^#{Regexp.escape(Path.provider_base)}/, Path.provider)
+ FileUtils.mkdir_p File.dirname(local_provider_path)
FileUtils.cp_r actual_path, local_provider_path
Util.log :created, Path.relative_path(local_provider_path)
actual_path = local_provider_path