# -*- 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        jghub sd-switchdir 3.3.1 v
revision            0
checksums           rmd160  ea41724a43805b5d061207833f2395a52f227456 \
                    sha256  a32a1e500153b8b35ecf45a3b8d6a0c510aa9595e030597b7c44167fc35812e0 \
                    size    25746

description         cd replacement with pattern matching against a frecency-ranked directory stack

long_description    SD provides two shell commands, sd and ds, for rapid navigation between \
                    previously visited directories. Directory ranking is derived from the full \
                    sequence of recorded visits using a configurable sliding window "frecency" model. \
                    sd acts as a drop-in replacement for the cd builtin\; ds exposes the ranked \
                    directory stack and provides inspection, management, and interactive \
                    selection via fzf if available.                    

categories          sysutils
license             MIT
maintainers         {gmail.com:veedeehjay @jghub} openmaintainer
platforms           any
supported_archs     noarch
installs_libs       no

github.tarball_from archive

use_configure       no

build {}

set docdir ${prefix}/share/doc/${subport}
set scriptdir ${prefix}/etc/profile.d

destroot {
    xinstall -d ${destroot}${docdir} ${destroot}${scriptdir}
    xinstall -m 0644 -W ${worksrcpath} \
        CHANGELOG.md \
        LICENSE \
        README.md \
        ${destroot}${docdir}
    xinstall ${worksrcpath}/sd.ksh ${destroot}${scriptdir}
}

notes "
To use SD, add the following line to your shell rc file:

. ${scriptdir}/sd.ksh

After sourcing, run 'ds -m' for full documentation including configuration.
"
