Ptah(プタハ)のインストール
リリースインストーラーは、使っている OS とアーキテクチャ向けのアーカイブをダウンロードし、SHA-256 チェックサムを検証し、管理者権限なしで ptah、ptah-compat、ptah-ls を導入する。
$ curl -fsSL https://ptah.run/install.sh | sh
導入先は ~/.local/bin。端末、tar、curl が必要。Homebrew でもよい: brew install stokaro/ptah/ptah。アーカイブの取得にはブラウザではなく curl か gh を使うこと。ブラウザでのダウンロードには検疫属性が付き、アドホック署名のバイナリは Gatekeeper に拒否される。
$ curl -fsSL https://ptah.run/install.sh | sh # curl がない場合 $ wget -qO- https://ptah.run/install.sh | sh
導入先は ~/.local/bin。アーカイブ: ptah_0.13.0_linux_amd64.tar.gz、ptah_0.13.0_linux_arm64.tar.gz。
PS> irm https://ptah.run/install.ps1 | iex
PowerShell 5.1 以降。導入先は %LOCALAPPDATA%\Ptah\bin で、無効にしない限りユーザーの Path も更新する。バージョンを固定するには $env:PTAH_INSTALL_VERSION = 'v0.13.0'。
$ brew install stokaro/ptah/ptah # 開発ブランチ。ソースからビルドする $ brew install --HEAD stokaro/ptah/ptah-edge
macOS と Linux。どちらの formula も同じ名前のバイナリを提供するので、切り替えるときは先に一方を削除すること。
$ go install ptah.run/cmd/ptah@v0.13.0 $ go install ptah.run/cmd/ptah-compat@v0.13.0 $ go install ptah.run/cmd/ptah-ls@v0.13.0
バイナリは GOBIN、設定されていなければ $(go env GOPATH)/bin に入る。このディレクトリは自動では PATH に載らない。
$ git clone https://github.com/stokaro/ptah.git $ cd ptah $ make build
make build は go.mod が宣言するツールチェーンを使い、ptah、ptah-compat、ptah-ls と統合テストランナーを bin/ 以下に書き出す。
ptah: sha256 verified against checksums.txt ptah: installed ptah, ptah-compat, ptah-ls in <install directory> Version: <installed version>
Version: の行は、導入されたバイナリ自身が出力したもの。スクリプトは成功を報告する前にそれを実行する。Linux と macOS では、導入先が PATH に載っていない場合に export PATH="$HOME/.local/bin:$PATH" を表示する。
$ ptah version $ ptah-compat version $ ptah-ls --version
いずれもバージョン、コミット、ビルド日時、Go のツールチェーン、プラットフォームを表示する。ptah-compat は --version フラグではなく version コマンドを使う。
install.sh | sh -s -- --version v0.13.0checksums.txt は Sigstore で署名されている。cosign verify-blob で検証するか、--verify-signature を渡す。curl -fsSL https://ptah.run/install.sh -o install.sh && less install.sh