3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Arch Linux の PKGBUILD を cURL して見るシェル関数

Posted at

これを .zshrc とか .bashrc とかにコピペするなりしてください。

pkgbuild-preview () {
    if [ `curl -LI "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/PKGBUILD?h=packages/$1" -o /dev/null -w '%{http_code}\n' -s | grep 200` ] ; then
        curl "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/PKGBUILD?h=packages/$1" | less
    else
        curl https://aur.archlinux.org/packages/`echo $1|sed -e "s/^\(.\{2\}\).*/\1/"`/$1/PKGBUILD | less
    fi
}

使用例

% pkgbuild-preview bash # 公式レポジトリ
% pkgbuild-preview mikutter # AUR

これでいい感じに less した奴が見られると思います。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?