Files
chromebrew/packages/acquia_cli.rb
2024-09-05 09:18:43 +10:00

26 lines
1.0 KiB
Ruby

require 'package'
class Acquia_cli < 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 '2.29.2'
license 'GPL-2.0'
compatibility 'x86_64 aarch64 armv7l'
source_url "https://github.com/acquia/cli/releases/download/#{version}/acli.phar"
source_sha256 '6c40072ce76a30b3a659c53343be8364402dd3a68e1dd7196a28168b86f6b285'
depends_on 'php83' unless File.exist? "#{CREW_PREFIX}/bin/php"
no_compile_needed
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`
abort "acli requires php >= 8.0. php#{major.chomp}#{minor.chomp} does not meet the minimum requirement.".lightred unless major.empty? || minor.empty? || ((major.to_i >= 8) && (minor.to_i >= 0))
end
def self.install
FileUtils.install 'acli.phar', "#{CREW_DEST_PREFIX}/bin/acli", mode: 0o755
end
end