Files
chromebrew/packages/wp_cli.rb
supechicken 944607d5ac Change deprecated File.exists?/Dir.exists? to File.exist?/Dir.exist? (#6893)
* Change `File.exists?` to `File.exist?`

* Change `Dir.exists?` to `Dir.exist?`
2022-03-21 13:24:13 -04:00

22 lines
713 B
Ruby

require 'package'
class Wp_cli < Package
description 'The command line interface for WordPress'
homepage 'https://wp-cli.org/'
version '2.6.0'
license 'LGPL-3'
compatibility 'all'
source_url 'SKIP'
depends_on 'php74' unless File.exist? "#{CREW_PREFIX}/bin/php"
def self.build
system "curl -#LO https://github.com/wp-cli/wp-cli/releases/download/v#{version}/wp-cli-#{version}.phar"
abort 'Checksum mismatch. :/ Try again.'.lightred unless Digest::SHA256.hexdigest( File.read("wp-cli-#{version}.phar") ) == 'd166528cab60bc8229c06729e7073838fbba68d6b2b574504cb0278835c87888'
end
def self.install
system "install -Dm755 wp-cli-#{version}.phar #{CREW_DEST_PREFIX}/bin/wp"
end
end