Updates preload to only read .slo files and fixes typo in readme

master
sloum 2 years ago
parent bb4cd1b34f
commit e38034a467

@ -509,7 +509,7 @@ A Makefile is available. Running `make` will build in the local directory. Runni
## Running
All of these assume slosh is on your `$PATH`:
All of these assume slope is on your `$PATH`:
To run the repl:

@ -409,16 +409,17 @@ func getPreloadDir() string {
}
func preloadFiles() {
files, err := ioutil.ReadDir(PreloadDir)
files, err := filepath.Glob(filepath.Join(PreloadDir, "*.slo"))
if err != nil {
fmt.Fprint(os.Stderr, "Could not preload files. Reading preload directory failed\n")
}
exp := make([]expression, len(files))
for i := range files {
if files[i].IsDir() {
f, err := os.Stat(files[i])
if err != nil || f.IsDir() {
continue
}
exp[i] = filepath.Join(PreloadDir, files[i].Name())
exp[i] = filepath.Join(files[i])
}
loadFiles(exp)
}

Loading…
Cancel
Save