# Copyright 2026 Nadeŭka <me+oss@nadevko.cc>
# Distributed under the terms of the GNU General Public License v2
EAPI=9

inherit git-r3 go-module

DESCRIPTION='Prompt theme engine for any shell'
HOMEPAGE='
	https://ohmyposh.dev
	https://github.com/JanDeDobbeleer/oh-my-posh
'
EGIT_REPO_URI=https://github.com/JanDeDobbeleer/${PN}.git
S+=/src
LICENSE=MIT

SLOT=0
IUSE=+themes

BDEPEND='>=dev-lang/go-1.26.0'

src_unpack() {
	git-r3_src_unpack
	go-module_live_vendor
}

src_compile() {
	ego build -o oh-my-posh .
}

src_test() {
	ego test -v ./...
}

src_install() {
	dobin oh-my-posh
	einstalldocs

	if use themes; then
		insinto /usr/share/oh-my-posh/themes
		doins "${WORKDIR}"/${P}/themes/*.json
	fi
}