unversioned = `git ls-files -o src`.strip
if !unversioned.empty?
  puts "Error: Unversioned files in tree, exiting.\n#{unversioned}"
  exit 1
end

version = `jq -r .version src/manifest.json`.strip
if version.empty?
  puts 'Error: Package version not found in manifest.json, exiting.'
  exit 1
end

out = "marinara-#{version}.zip"
`(cd src && zip -r - .) > #{out}`

puts "Package created: #{out}."

require 'json'
require 'zip/zip'

unversioned = `git ls-files -o src`.strip
if !unversioned.empty?
  puts "Error: Unversioned files in tree, exiting.\n#{unversioned}"
  exit 1
end

version = JSON.load(File.read('src/manifest.json'))['version']
out = "marinara-#{version}.zip"

Zip::ZipFile::open(out, 'w') do |zip|
  Dir['src/**/*'].each do |path|
    zip.add(path.sub(/^src\//, ''), path)
  end
end

puts "Package created: #{out}."

Update package creation to use Ruby zip library instead of OS zip utility.
Update package creation to use Ruby zip library instead of OS zip utility.
