Skip to content

Comment on Import.sh A module system for Bash and other Unix shellsparent

Comments

bfmOP

It looks like the IMPORT_CACHE can be used for vendoring.

A quick example:

    #!/usr/bin/env bash

    export IMPORT_CACHE="vendor/import" 

    source ./bin/import

    import "tootallnate/hello"
    import assert@2.1.3

    hello
    assert_equal foo bar

generates the following dir structure:
    vendor/import/
    ├── data
    │   ├── 0a1c5188c768b3b150f1a8a104bb71a3fa160aad
    │   └── a4f0a20c03de97c490413f0c58f480f2ad17ba27
    ├── links
    │   └── https
    │       └── import.sh
    │           ├── assert@2.1.3 -> ../../../data/0a1c5188c768b3b150f1a8a104bb71a3fa160aad
    │           └── tootallnate
    │               └── hello -> ../../../../data/a4f0a20c03de97c490413f0c58f480f2ad17ba27
    └── locations
        └── https
            └── import.sh
                ├── assert@2.1.3
                └── tootallnate
                    └── hello
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.