Skip to content

import should take an optional "fromPath" parameter #55

@JoeStrout

Description

@JoeStrout

When not supplied, then import searches for the named lib(s) using env.importPaths as always.

If given a fromPath that specifies a directory, then import looks only in that directory (and subdirectories?).

If given a fromPath that specifies a file, then it imports exactly that file, but still calls it by the name given in the first parameter. (It would be an error to provide a list of more than one lib name, when fromPath specifies only a single file.)

Benefit: this would be useful when you want to import something that's not in the standard import paths, or when you want to be sure that your import comes from the standard place no matter what monkeying with env.importPaths may have been done by the user.

(This change affects most MiniScript products, including command-line MiniScript, Farmtronics, Soda, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions