Package Details: oh-my-posh 24.6.5-1

Git Clone URL: https://aur.archlinux.org/oh-my-posh.git (read-only, click to copy)
Package Base: oh-my-posh
Description: A prompt theme engine for any shell.
Upstream URL: https://github.com/JanDeDobbeleer/oh-my-posh
Keywords: oh-my-posh
Licenses: MIT
Submitter: wszqkzqk
Maintainer: wszqkzqk
Last Packager: wszqkzqk
Votes: 7
Popularity: 0.103583
First Submitted: 2022-10-20 13:30 (UTC)
Last Updated: 2024-11-21 07:37 (UTC)

Dependencies (3)

Required by (1)

Sources (1)

Latest Comments

pr0m1x commented on 2024-11-21 08:46 (UTC) (edited on 2024-11-21 08:47 (UTC) by pr0m1x)

@mrjxtr I also have the same problem. Temporary fix:

git switch -c master
git branch --set-upstream-to=origin/master master

mrjxtr commented on 2024-11-21 08:40 (UTC) (edited on 2024-11-21 08:42 (UTC) by mrjxtr)

When I try to update using yay -Syu there is a "No Current Branch" error. and when I cd into the directory git is ~/.cache/yay/oh-my-posh @8bd21b37 instead of master or main or anything else

❯ yay -Syu
[sudo] password for mrjxtr: 
:: Synchronizing package databases...
 core is up to date
 extra                       7.5 MiB  4.38 MiB/s 00:02 [############################] 100%
 multilib is up to date
:: Searching AUR for updates...
:: Searching databases for updates...
:: 2 packages to upgrade/install.
2  extra/eza       0.20.8-1 -> 0.20.9-1
1  aur/oh-my-posh  24.6.4-1 -> 24.6.5-1
==> Packages to exclude: (eg: "1 2 3", "1-3", "^4" or repo name)
 -> Excluding packages may cause partial upgrades and break systems
==> 2
AUR Explicit (1): oh-my-posh-24.6.5-1
:: PKGBUILD up to date, skipping download: oh-my-posh
 -> error merging /home/mrjxtr/.cache/yay/oh-my-posh: fatal: No current branch.

a821 commented on 2024-07-04 06:23 (UTC)

@leonkacowicz: builds fine for me. Could you try with just makepkg to take yay out of the equation?

leonkacowicz commented on 2024-07-03 23:57 (UTC)

I'm getting this error msg:

~/.cache/yay/oh-my-posh/src/oh-my-posh-21.16.1/src/go.mod:3: invalid go version '1.22.3': must match format 1.23

ZhangHua commented on 2023-08-07 09:36 (UTC)

You must call "./${pkgname}" in line 23-25, because oh-my-posh is not in the $PATH absolutely.

ZhangHua commented on 2023-08-06 12:25 (UTC)

It seems that you forget to generate completions such as oh-my-posh.sh, oh-my-posh.fish and _oh-my-posh. Which results that there will no required files found when calling package()

What's more, I think you may set build.Version to $pkgver instead v$pkgver. Using v$pkgver results that the version string used for checking updates is changed to vv18.2.5 instead v18.2.5.

Sacro commented on 2023-07-19 17:28 (UTC) (edited on 2023-07-19 17:29 (UTC) by Sacro)

Please can you generate and add completions? This does it.

diff --git a/PKGBUILD b/PKGBUILD
index dae4e03..7f20c0d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,7 +19,11 @@ build() {
     export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"

     cd "$pkgname-$pkgver/src"
-    go build
+    go build -o "$pkgname"
+
+    "${pkgname}" completion bash > "${pkgname}.sh"
+    "${pkgname}" completion fish > "${pkgname}.fish"
+    "${pkgname}" completion zsh > "_${pkgname}"
 }

 package() {
@@ -28,4 +32,8 @@ package() {
     install -Dm 644 "../COPYING" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
     install -d "${pkgdir}/usr/share/oh-my-posh/themes"
     install -m 644 ../themes/* -t "${pkgdir}/usr/share/oh-my-posh/themes"
+
+    install -Dm 644 "${pkgname}.sh" "${pkgdir}/usr/share/bash-completion/completions/${pkgname}"
+    install -Dm 644 "${pkgname}.fish" "${pkgdir}/usr/share/fish/completions/${pkgname}.fish"
+    install -Dm 644 "_${pkgname}" "${pkgdir}/usr/share/zsh/site-functions/_${pkgname}"
 }

ZhangHua commented on 2023-07-10 06:18 (UTC) (edited on 2023-07-10 06:19 (UTC) by ZhangHua)

Please consider adding -X github.com/jandedobbeleer/oh-my-posh/src/build.Version=v$pkgver -X github.com/jandedobbeleer/oh-my-posh/src/build.Date=$(date +%F) to -ldflags so we can print detailed info in oh-my-posh version --verbose command. However, this means that you need to move -ldflags=-linkmode=external in GOFLAGS variable to go build command as its params, because GOFLAGS does not support value with space.

You can use this patch to achieve this:

diff --git a/PKGBUILD b/PKGBUILD
index 570455b..18423fe 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
 # Maintainer: wszqkzqk <wszqkzqk@qq.com>
 pkgname=oh-my-posh
 pkgver=17.7.0
-pkgrel=1
+pkgrel=2
 pkgdesc="A prompt theme engine for any shell."
 arch=('x86_64' 'armv7h' 'aarch64')
 url="https://github.com/JanDeDobbeleer/oh-my-posh"
@@ -16,10 +16,10 @@ build() {
     export CGO_CFLAGS="${CFLAGS}"
     export CGO_CXXFLAGS="${CXXFLAGS}"
     export CGO_LDFLAGS="${LDFLAGS}"
-    export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+    export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"

     cd "$pkgname-$pkgver/src"
-    go build
+    go build -ldflags="-linkmode=external -X github.com/jandedobbeleer/oh-my-posh/src/build.Version=v$pkgver -X github.com/jandedobbeleer/oh-my-posh/src/build.Date=$(date +%F)"
 }

 package() {

TrialnError commented on 2023-01-06 18:41 (UTC)

Temporary fix for the name of the created binary:

@@ -22,7 +22,7 @@ build() {
 }
 package() {
     cd "$pkgname-$pkgver/src"
-    install -Dm 755 ./oh-my-posh -t "${pkgdir}/usr/bin/"
+    install -Dm 755 ./src -D "${pkgdir}/usr/bin/oh-my-posh"
     install -Dm 644 "../COPYING" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
     install -d "${pkgdir}/usr/share/oh-my-posh/themes"
     install -m 644 ../themes/* -t "${pkgdir}/usr/share/oh-my-posh/themes"

a821 commented on 2023-01-06 12:58 (UTC) (edited on 2023-01-07 12:56 (UTC) by a821)

Edit: fixed, thanks :-)

fails to build due to an error in line #25, because the binary is called src instead of oh-my-posh. Maybe an issue to raise upstream.