# -*- 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.2.1 v
revision            0
checksums           rmd160  7b44ef17e7c4b341eb164d3fc3a3e930d6a13d87 \
                    sha256  7caa560098ab4923d393a2e115a68c5f6379f15fb990b966f912247440cf2c40 \
                    size    23536

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 power-law scoring 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         nomaintainer
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.
"
