-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathPKGBUILD
45 lines (38 loc) · 1.17 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Maintainer: Your Name <[email protected]>
# Maintainer: Nicholas Schwab <[email protected]>
pkgname=please-cli
pkgver=WillBeSetAutomatically
pkgrel=1
pkgdesc='An AI helper script to create CLI commands.'
arch=('any')
license=('Apache')
depends=('bash' 'jq' 'curl')
optdepends=('libsecret: store OpenApi key in keychain'
'xclip: copy command to clipboard on X'
'wl-clipboard: copy command to clipboard on Wayland')
makedepends=('sed' 'git')
install="${pkgname}.install"
source=('git+https://github.com/TNG/please-cli.git')
sha256sums=('SKIP')
pkgver() {
cd "$pkgname"
if [ -z "$VERSION" ]; then
_tag=$(git tag --sort=v:refname | tail -n1)
printf '%s.r%s.g%s' "${_tag#v}" "$(git rev-list "$_tag"..HEAD --count)" "$(git rev-parse --short HEAD)"
else
printf "$VERSION"
fi
}
prepare() {
cd "$pkgname"
if [ -n "$VERSION" ]; then
# Make specific version instead
git checkout "release/v${VERSION}"
fi
# Patching the install command in an error message.
sed -i -e 's/sudo apt install libsecret-tools/sudo pacman -S libsecret/' 'please.sh'
}
package() {
cd "$pkgname"
install -m 755 -DT 'please.sh' "${pkgdir}/usr/bin/please"
}