diff options
-rw-r--r-- | src/web-routes.js | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/web-routes.js b/src/web-routes.js index a49f6d0e..b68dccbf 100644 --- a/src/web-routes.js +++ b/src/web-routes.js @@ -1,4 +1,4 @@ -import {readdir} from 'node:fs/promises'; +import {readdir, stat} from 'node:fs/promises'; import * as path from 'node:path'; import {fileURLToPath} from 'node:url'; @@ -103,17 +103,24 @@ export async function identifyDynamicWebRoutes({ to: ['thumb.root'], statically: 'symlink', }, - - // {statically: 'copy'} is not workable for individual files - // at the moment, so this remains a symlink. - { - from: path.join(path.resolve(mediaPath), 'favicon.ico'), - to: ['shared.path', 'favicon.ico'], - statically: 'symlink', - }, ]), () => { + const from = + path.resolve(path.join(mediaPath, 'favicon.ico')); + + return stat(from).then( + // {statically: 'copy'} is not workable for individual files + // at the moment, so this remains a symlink. + () => [{ + from, + to: ['shared.path', 'favicon.ico'], + statically: 'symlink', + }], + () => []); + }, + + () => { if (!wikiCachePath) return []; const from = |