Skip to content

Commit 7f72b57

Browse files
vladimyragnivade
authored andcommitted
Cleanup
1 parent c344710 commit 7f72b57

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

lib/index.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,14 @@ function readShortPagesIndex() {
106106
})
107107
.catch(() => {
108108
// File is not present; we need to create the index.
109-
return buildShortPagesIndex();
110-
})
111-
.then((idx) => {
112-
if (Object.keys(idx).length <= 0) {
113-
return idx;
114-
}
115-
return fs.writeJson(shortIndexFile, idx).then(() => {
109+
return buildShortPagesIndex().then((idx) => {
110+
if (Object.keys(idx).length <= 0) {
111+
return idx;
112+
}
116113
shortIndex = idx;
117-
return shortIndex;
114+
return fs.writeJson(shortIndexFile, shortIndex).then(() => {
115+
return shortIndex;
116+
});
118117
});
119118
});
120119
}

0 commit comments

Comments
 (0)