From 22562555ee9977090d382ef41d6bb8d3b46fe10b Mon Sep 17 00:00:00 2001 From: Qi Xiao Date: Wed, 1 Feb 2017 12:03:54 -0800 Subject: [PATCH] Find libraries in ~/.elvish/lib when use'ing. --- eval/builtin_special.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eval/builtin_special.go b/eval/builtin_special.go index 9cdaf8f8..933559bf 100644 --- a/eval/builtin_special.go +++ b/eval/builtin_special.go @@ -170,11 +170,11 @@ func use(ec *EvalCtx, modname string, pfilename *string) { source, err = readFileUTF8(filename) maybeThrow(err) } else { - // No filename; defaulting to $datadir/$modname.elv. + // No filename; defaulting to $datadir/lib/$modname.elv. if ec.DataDir == "" { throw(ErrNoDataDir) } - filename = ec.DataDir + "/" + strings.Replace(modname, ":", "/", -1) + ".elv" + filename = ec.DataDir + "/lib/" + strings.Replace(modname, ":", "/", -1) + ".elv" if _, err := os.Stat(filename); os.IsNotExist(err) { // File does not exist. Try loading from the table of builtin // modules.