Skip to content

Commit

Permalink
#115 list all objects in external assets dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Skytrias committed Dec 25, 2017
1 parent ac4cbc2 commit 7263b36
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/common/external_assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,17 @@ export default class ExternalAssets {

return dir;
}

public static list(callback) {
let dir = path.join(store.get('asset-dir'), '*.png')

glob(dir, {}, (err, files) => {
let filenames = []

for (let file of files)
filenames.push(path.basename(file, '.png'))

callback(err,filenames)
})
}
}

0 comments on commit 7263b36

Please sign in to comment.