Fix: index.htmlでロゴのパスが誤っている問題を修正 / New: ディレクトリを探す関数
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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" />
|
||||||
|
|||||||
Reference in New Issue
Block a user