mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-10 07:57:59 -05:00
30 lines
1.2 KiB
Ruby
30 lines
1.2 KiB
Ruby
require 'package'
|
|
|
|
class Acli < Package
|
|
description 'Acquia CLI - The official command-line tool for interacting with the Drupal Cloud Platform and services.'
|
|
homepage 'https://github.com/acquia/cli'
|
|
version '1.25.1'
|
|
license 'GPL-2.0'
|
|
compatibility 'all'
|
|
source_url 'SKIP'
|
|
|
|
depends_on 'php74' unless File.exist? "#{CREW_PREFIX}/bin/php"
|
|
|
|
def self.preflight
|
|
major = `php -v 2> /dev/null | head -1 | cut -d' ' -f2 | cut -d'.' -f1`
|
|
minor = `php -v 2> /dev/null | head -1 | cut -d' ' -f2 | cut -d'.' -f2`
|
|
unless major.empty? or minor.empty? or (major.to_i >= 7 and minor.to_i >= 3)
|
|
abort "acli requires php >= 7.3. php #{major.chomp}.#{minor.chomp} does not meet the minimum requirement.".lightred
|
|
end
|
|
end
|
|
|
|
def self.install
|
|
system "curl -#LO https://github.com/acquia/cli/releases/download/#{version}/acli.phar"
|
|
unless Digest::SHA256.hexdigest( File.read('acli.phar') ) == '2f2d3c7312aa292b18b3f83e887e8a76b939d3e5552c5fdd3193a8e25ef74ed3'
|
|
abort 'Checksum mismatch. :/ Try again.'.lightred
|
|
end
|
|
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
|
|
FileUtils.install 'acli.phar', "#{CREW_DEST_PREFIX}/bin/acli", mode: 0o755
|
|
end
|
|
end
|