# -*- 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.0 v
revision            0
checksums           rmd160  a7f783150ce0bbb384e8a2d43891904bb379a707 \
                    sha256  ae10864df6bc9671935161bf025bb316d9aefe6ee37692be1ef9e6572aa25ad7 \
                    size    24970

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.
"
