# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github 1.0

github.setup        jonmosco kube-ps1 1.0.0 v
github.tarball_from archive
revision            0
categories          sysutils
platforms           {darwin any}
supported_archs     noarch
maintainers         {breun @breun} openmaintainer
license             Apache-2

description         Kubernetes prompt info for bash and zsh
long_description    A script that lets you add the current Kubernetes context and namespace \
                    configured on kubectl to your Bash/Zsh prompt strings (i.e. the \$PS1).

checksums           rmd160  5d8affe334711805ae8daa41c785a27f4321321e \
                    sha256  af44982ad27e492d3ade2d03223c944523070b0462839a9260df7483692c1bb0 \
                    size    581233

depends_run         path:${prefix}/bin/kubectl:kubectl-1.36

use_configure       no
build {}

destroot    {
    xinstall -m 755 -d ${destroot}${prefix}/share/${name}
    copy ${worksrcpath}/CHANGELOG.md \
        ${worksrcpath}/CONTRIBUTING.md \
        ${worksrcpath}/img \
        ${worksrcpath}/kube-ps1.fish \
        ${worksrcpath}/kube-ps1.sh \
        ${worksrcpath}/LICENSE \
        ${worksrcpath}/README.md \
        ${destroot}${prefix}/share/${name}
}

notes "
Bash example (~/.bashrc):

    source ${prefix}/share/${name}/kube-ps1.sh
    PS1=\'\$(kube_ps1)\'\$PS1

Zsh example (~/.zshrc):

    source ${prefix}/share/${name}/kube-ps1.sh
    PROMPT=\'\$(kube_ps1)\'\$PROMPT

Fish example (~/.config/fish/config.fish):

    source ${prefix}/share/${name}/kube-ps1.fish
    function fish_prompt
        echo -n (kube_ps1) ' '
        # your existing prompt here
    end
"
