rawiriblundell / sh_libpath

Making shell scripts more robust with libraries
Apache License 2.0
11 stars 2 forks source link

Simplify import() #18

Closed rawiriblundell closed 2 years ago

rawiriblundell commented 2 years ago

import does not need to be so pythonistic. We can drop the from and all keywords and use the following behaviour:

import [SH_LIBPATH implied/]path/to_library -> attempts to figure out if library exists. No? If the extension isn't .sh, then does path/to_library.sh exist? Yes? Load it.

import [SH_LIBPATH implied/]path/to_library.sh -> for loading a specific named library

import /a/different/path/to_library.sh -> as above, load a specific pathed library

import [SH_LIBPATH implied/]path -> just load all of the libraries in this directory. There's no need to handle from or all keywords: import text should just import all the libraries under text/

rawiriblundell commented 2 years ago

Largely done in commit 742d3f0