Skip to content

if 'package --src somedir' then glob is 'somedir/**/*' [fixes #105] #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion lib/bosh/gen/generators/package_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def copy_src_files
def package_specification
src_files =
files.map {|f| "#{name}/#{File.basename(f)}"} + # new blobs
existing_sources # existing files/sources, like 'myapp/**/*'
existing_sources_as_globs # existing directories, like 'myapp'
config = { "name" => name, "dependencies" => dependencies, "files" => src_files }
create_file package_dir("spec"), YAML.dump(config)
end
Expand Down Expand Up @@ -172,6 +172,16 @@ def tarballs_in_files
def zipfiles_in_files
files.select { |file| file =~ /\.zip/ }
end

def existing_sources_as_globs
existing_sources.map do |src|
if File.directory?(File.join("src", src))
"#{src}/**/*"
else
src
end
end
end

# If primary_package_file was mysql's client-5.1.62-rel13.3-435-Linux-x86_64.tar.gz
# then returns "client-5.1.62-rel13.3-435-Linux-x86_64"
Expand Down