mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-10 07:57:59 -05:00
* Rename IgnoredPatterns to AllowedPatterns. * Exclude docopt.rb (not our code) from Rubocop * Disable Style/RedundantReturn * Disable Style/MutableConstant * Disable Style/NumericLiterals * Set Layout/IndentationStyle to spaces * Temporarily disable various cops. * Add Rubocop CI via Octocop * Lint tree with rubocop -A -c .rubocop.yml Co-authored-by: Satadru Pramanik <satadru@gmail.com>
26 lines
1.0 KiB
Ruby
26 lines
1.0 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 '2.2.0'
|
|
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`
|
|
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
|
|
downloader "https://github.com/acquia/cli/releases/download/#{version}/acli.phar",
|
|
'374f024ef474e5642ef424820f6ecdebb30f2f89535fdab400e6b61e238b85a6'
|
|
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
|
|
FileUtils.install 'acli.phar', "#{CREW_DEST_PREFIX}/bin/acli", mode: 0o755
|
|
end
|
|
end
|