The script is working perfectly fine. The only issue I am facing is path. Once the zip file is created. If I unzip its. its having a complete path of the file like:--
/name_the_file/Users/user_name/projects/project_name/public/system/files/10/original/*
I just want to make it
name_of_the_file/*
desc "Create Zip file"
task :create_zip => :environment do
directory_path = "#{RAILS_ROOT}/public/system/files/10/original"
bundle_filename="#{directory_path}/"+ "name_of_file.zip"
filenames = "#{directory_path}/*"
%x{ cd #{directory_path}}
%x{ zip -r #{bundle_filename} #{filenames}}
end
PS:- I want to create zip files. No tar, gzip etc