-1

How can we change this bash operator with any resource

Just i am moving particular directories in to particular directories

bash " deploy" do
  cwd "#{stage}"
  code <<-EOH
    cp -pr "#{stage}/#{name}-#{package_version}.tar"  "#{stage_operator}/"
    tar xvf "#{stage}/#{name}-#{package_version}.tar"

    mv  #{stage}/processing/* #{scripts}/
    mv  #{stage}/config/* #{config}/
    mv  #{stage}/dags/*  #{dags}/
    mv  #{stage}/plugins/* #{ps}/
    mv  #{stage}/_lib/*  #{libs}/ 
 EOH
 not_if "ls -l \"#{stage_operator}\"|grep \"#{name}-#{package_version}.tar\" "
end
Udhay
  • 7
  • 7

1 Answers1

0

Obligatory plug (I wrote it) but the poise-archive cookbook/resource probably covers what you need. Hard to tell precisely since you only showed a small snippet of the code.

On the other hand if what you have there works, probably just run with it.

coderanger
  • 52,400
  • 4
  • 52
  • 75