Skip to content

Commit 90842b0

Browse files
committed
revert; unnecessary commit
1 parent 579c364 commit 90842b0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

scripts/stdlib/utils.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,21 @@ module.exports.TARGET_REFLECT_MODULE_DIR = TARGET_ROOT_PATH + '/kotlin-reflect';
1717
module.exports.exists = async function exists(path) {
1818
try {
1919
await access(path);
20+
return true;
2021
} catch (e) {
21-
return false;
22+
//
2223
}
23-
return true;
24+
return false;
2425
};
2526

2627
module.exports.writeRedirects = async function writeRedirects(name, urls) {
2728
const content = urls
28-
.map(([from, to]) => ({ from: '/' + to.replace(/\/index\.html$/, '/'), to: '/' + from }))
29-
.sort((a, b) => a.from.localeCompare(b.from));
29+
.map(([from, to]) => ({ from: '/' + from, to: '/' + to.replace(/\/index\.html$/, '/') }))
30+
.sort(function(a, b) {
31+
if (a.from < b.from) return -1;
32+
if (a.from > b.from) return 1;
33+
return 0;
34+
});
3035

3136
console.log(`write ${urls.length} redirects...`);
3237
await writeFile(name, YAML.stringify(content), 'utf8');

0 commit comments

Comments
 (0)