Sha256: 56ed2f6ba792caf308276a4a0cb39a0292d2fbb44571b8450302f3bf7c73bdcf

Contents?: true

Size: 803 Bytes

Versions: 2

Compression:

Stored size: 803 Bytes

Contents

#!/usr/bin/env ruby

require 's3repo'
require 'mercenary'

def find(pattern, limits)
  Dir.glob(pattern).select { |x| !limits || limits.include?(File.dirname(x)) }
end

Mercenary.program(:s3repo) do |p|
  p.version S3Repo::VERSION
  p.description 'Package management tool for Archlinux repos'
  p.syntax 's3repo <subcommand> [args]'

  p.command(:build) do |c|
    c.syntax 'build [package...]'
    c.description 'Build package files from PKGBUILDs'

    c.action do |args, _|
      S3Repo.new.build_packages find('*/PKGBUILD', args)
    end
  end

  p.command(:upload) do |c|
    c.syntax 'upload [package...]'
    c.description 'Upload packages to repo'

    c.action do |args, _|
      S3Repo.new.add_packages find('*/*.pkg.tar.xz', args)
    end
  end

  p.action do
    puts p
    exit 1
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
s3repo-0.1.4 bin/s3repo
s3repo-0.1.3 bin/s3repo