Files
chromebrew/packages/powershell.rb
2024-07-24 12:15:55 +10:00

37 lines
1.5 KiB
Ruby

require 'package'
class Powershell < Package
description 'Powershell is a cross-platform, task-based command-line shell and scripting language that helps rapidly automate tasks that manage operating systems and processes'
homepage 'https://learn.microsoft.com/en-us/powershell/'
version '7.4.4'
license 'MIT'
compatibility 'x86_64 aarch64 armv7l'
source_url({
aarch64: "https://github.com/PowerShell/PowerShell/releases/download/v#{version}/powershell-#{version}-linux-arm32.tar.gz",
armv7l: "https://github.com/PowerShell/PowerShell/releases/download/v#{version}/powershell-#{version}-linux-arm32.tar.gz",
x86_64: "https://github.com/PowerShell/PowerShell/releases/download/v#{version}/powershell-#{version}-linux-x64.tar.gz"
})
source_sha256({
aarch64: '8725138d3261c056ee103eb9728c25ff62cc0e0d72a3ecdc3c1139d42965d34b',
armv7l: '8725138d3261c056ee103eb9728c25ff62cc0e0d72a3ecdc3c1139d42965d34b',
x86_64: '49435200c43fe6ff83f3e62f9909b4062ed817a31d0697fb57611ea4faca633b'
})
depends_on 'xdg_base'
no_compile_needed
no_shrink
def self.install
FileUtils.mkdir_p %W[#{CREW_DEST_PREFIX}/bin #{CREW_DEST_PREFIX}/share/powershell]
FileUtils.cp_r Dir['*'], "#{CREW_DEST_PREFIX}/share/powershell"
FileUtils.chmod 0o755, "#{CREW_DEST_PREFIX}/share/powershell/pwsh"
FileUtils.ln_s "#{CREW_PREFIX}/share/powershell/pwsh", "#{CREW_DEST_PREFIX}/bin/pwsh"
end
def self.postinstall
ExitMessage.add "\nTo get started, execute 'pwsh'.\n".lightblue
end
end