rawiriblundell / sh_libpath

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

import(): dynamically handle extensions #15

Closed rawiriblundell closed 2 years ago

rawiriblundell commented 2 years ago

Example:

import puts

If no extension is given, import() should try to figure it out automatically.

Example logic, shell is zsh:

puts.zsh -> exists -> source puts.zsh
 |-> doesn't exist -> puts.sh -> exists -> source puts.sh
rawiriblundell commented 2 years ago

Largely done in commit 742d3f0. If an extension is given, that is attempted. Otherwise .sh is assumed and tested. This is clean and simple.