Skip to content

Commit 181ba47

Browse files
committed
fixes allNames bug
1 parent a9e9630 commit 181ba47

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/imageFiles.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export const dirFor = (type, imageDir) => {
88
else return imageDir;
99
};
1010

11-
export const allNames = (type) => {
12-
return fs.readdirSync(dirFor(type)).filter(function(imageFileName) {
11+
export const allNames = (type, imageDir) => {
12+
return fs.readdirSync(dirFor(type, imageDir)).filter(function(imageFileName) {
1313
return imageFileName.match(/\.png/);
1414
}).map(function(imageFileName) {
1515
return imageFileName.replace(/\.png/, '');
@@ -19,7 +19,7 @@ export const allNames = (type) => {
1919
export const allPaths = (type, imageDir = DEFAULT_IMAGE_DIR) => {
2020
var dir;
2121
dir = dirFor(type, imageDir);
22-
return allNames(type).map(function(name) {
22+
return allNames(type, imageDir).map(function(name) {
2323
return path.join(dir, name + '.png');
2424
});
2525
};

0 commit comments

Comments
 (0)