# -*- 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
PortGroup           makefile 1.0

github.setup        kenseitehdev goto 9d4cbe8f438b2bdb7f6d0067fbcd12be48181eb5
version             20260123
revision            0
categories          sysutils
# Not yet set, update this:
license             Permissive
maintainers         nomaintainer
description         Directory browser and manager for terminal
long_description    {*}${description}
checksums           rmd160  0153a9750c82cb3069517438377d35018f024d5f \
                    sha256  b3d8e0aa22c796716b329804c96ff042dd4e8fe54652ea106e2244a226c6b222 \
                    size    27146
github.tarball_from archive

# https://github.com/kenseitehdev/goto/issues/2
post-extract {
    delete -f ${worksrcpath}/build/main.o
}

compiler.c_standard 2011

depends_lib         port:ncurses

destroot {
    xinstall -m 755 ${worksrcpath}/bin/${name} ${destroot}${prefix}/bin/
}

notes "
Add goto function to a shell config (bashrc/zshrc etc.):

goto() \{
    local tempfile=\"~/.goto_path\"
    rm -f \"\$tempfile\"
    ${prefix}/bin/goto
    if \[ -f \"\$tempfile\" \]; then
        local target=\$(cat \"\$tempfile\")
        rm -f \"\$tempfile\"
        cd \"\$target\"
    fi
\}
"
