Sha256: 02bb9627c10c60037180b1879fdf4bd2e381b28a9c773c3e6864c748042891a7
Contents?: true
Size: 1.12 KB
Versions: 8
Compression:
Stored size: 1.12 KB
Contents
module ZendeskAppsTools module PackageHelper def app_package require 'zendesk_apps_support' @app_package ||= ZendeskAppsSupport::Package.new(app_dir.to_s) end def manifest begin @manifest ||= app_package.manifest rescue say_status "error", "Manifest file cannot be found in the given path. Check you are pointing to the path that contains your manifest.json", :red and exit 1 end end def zip(archive_path) require 'zip' Zip::File.open(archive_path, 'w') do |zipfile| app_package.files.each do |file| relative_path = file.relative_path path = relative_path say_status 'package', "adding #{path}" # resolve symlink to source path if File.symlink? file.absolute_path path = File.expand_path(File.readlink(file.absolute_path), File.dirname(file.absolute_path)) end if file.to_s == 'app.scss' relative_path = relative_path.sub 'app.scss', 'app.css' end zipfile.add(relative_path, app_dir.join(path).to_s) end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems