You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to copy a folder between two contexts.
There exists some aliases relying on cat to copy given files (e.g., local2in).
Following this idea, I tried to transfer the folder structure with tar:
…
- pipe:
- exec_local: tar --create --directory=$${kameleon_data_dir} -- xpctl
- exec_in: tar --directory=$${dest} --extract…
where xpctl is the folder I want to copy.
The --directory option of tar change to the directory before performing any operation (as documented in tar manual).
It is required, otherwise tar includes the full path to my folder, and the extraction in the other context is not correctly located.
This snippet fails with the following error (verbose output enabled):
[info] Looking for data ' -- xpctl'
[info] /path/to/kameleon/recipe/steps/data/ -- xpctl : nonexistent
[info] /path/to/kameleon/recipe/steps/data/ -- xpctl : nonexistent
Error: Cannot find data ' -- xpctl' used in '/path/to/kameleon/recipe/steps/setup/xpctl.yaml'
Digging a bit deeper into kameleon code base, this seems related to the regexp (see l. 21 & l. 24) used in resolve_data_dir_vars:
The regexp ends with (.*), and forbid the use of $${kameleon_data_dir} on its own.
Patching the regexp to end with (\S*) seemed to make the recipe works, but it changes the semantic, and forbids paths containing spaces to be used.
Maybe the regexp ((\S|\\\s)*) would be better by allowing spaces to be used when properly escaped.
If there is a simpler solution to copy the whole folder, I'm happy with it too 😃
The text was updated successfully, but these errors were encountered:
I need to copy a folder between two contexts.
There exists some aliases relying on
cat
to copy given files (e.g.,local2in
).Following this idea, I tried to transfer the folder structure with
tar
:where
xpctl
is the folder I want to copy.The
--directory
option oftar
change to the directory before performing any operation (as documented in tar manual).It is required, otherwise
tar
includes the full path to my folder, and the extraction in the other context is not correctly located.This snippet fails with the following error (verbose output enabled):
Digging a bit deeper into
kameleon
code base, this seems related to the regexp (see l. 21 & l. 24) used inresolve_data_dir_vars
:kameleon/lib/kameleon/utils.rb
Lines 20 to 34 in 7e7026d
The regexp ends with
(.*)
, and forbid the use of$${kameleon_data_dir}
on its own.Patching the regexp to end with
(\S*)
seemed to make the recipe works, but it changes the semantic, and forbids paths containing spaces to be used.Maybe the regexp
((\S|\\\s)*)
would be better by allowing spaces to be used when properly escaped.If there is a simpler solution to copy the whole folder, I'm happy with it too 😃
The text was updated successfully, but these errors were encountered: