diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-02 22:42:05 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-02 22:42:05 +0200 |
| commit | cf6f1c58a7298b0af1c13bb701032017563a6ed8 (patch) | |
| tree | c813153497c22c51d677970c56fe813ecaa07f7a /app/relay/runner.js | |
| parent | 1ea936fe292817fed706ed10fced63adbea07991 (diff) | |
basic dataset viewer with stuff clustered how i want it
Diffstat (limited to 'app/relay/runner.js')
| -rw-r--r-- | app/relay/runner.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/relay/runner.js b/app/relay/runner.js index 493df23..deb3aa0 100644 --- a/app/relay/runner.js +++ b/app/relay/runner.js @@ -117,7 +117,7 @@ export function list_directory(opt, cb) { const module = modules[opt.module] const dir = path.join(module.cwd, opt.dir.replace(/\.\.?\//g, '')) fs.readdir(dir, (err, files) => { - const statPromises = files.filter(f => f[0] !== '.').map(f => { + const statPromises = (files || []).filter(f => f[0] !== '.').map(f => { return new Promise((resolve, reject) => { const full_path = path.join(dir, f) fs.stat(full_path, (err, stat={}) => { @@ -133,6 +133,8 @@ export function list_directory(opt, cb) { }) Promise.all(statPromises).then(stats => { cb(stats) + }).catch(error => { + cb(error) }) }) } |
