Fix: index.htmlでロゴのパスが誤っている問題を修正 / New: ディレクトリを探す関数

This commit is contained in:
2026-03-21 12:05:59 +09:00
parent fa7a1e87ff
commit b61e1206fc
2 changed files with 27 additions and 2 deletions
+25
View File
@@ -0,0 +1,25 @@
import { existsSync } from "node:fs";
import { dirname, join } from "node:path";
export function findDir(
targetPath: string,
cwd: string,
): string {
let current = cwd;
while (true) {
const candidate = join(current, targetPath);
if (existsSync(candidate)) {
return candidate;
}
const parent = dirname(current);
if (parent === current) {
throw new Error(`Not found: ${targetPath}`);
}
current = parent;
}
}
+2 -2
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LynqChat</title> <title>LynqChat</title>
<link rel="icon" href="/lynqchat.svg" type="image/svg+xml"> <link rel="icon" href="/assets/lynqchat.svg" type="image/svg+xml">
</head> </head>
<body> <body>
<style> <style>
@@ -66,7 +66,7 @@
<div class="loading"> <div class="loading">
<img <img
class="logo" class="logo"
src="/lynqchat.svg" src="/assets/lynqchat.svg"
/> />
<div class="progress" /> <div class="progress" />