qfai 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -86,12 +86,29 @@ async function exists(target) {
86
86
  }
87
87
 
88
88
  // src/cli/lib/assets.ts
89
+ import { existsSync } from "fs";
89
90
  import path2 from "path";
90
91
  import { fileURLToPath } from "url";
91
92
  function getInitAssetsDir() {
92
93
  const base = import.meta.url;
93
94
  const basePath = base.startsWith("file:") ? fileURLToPath(base) : base;
94
- return path2.resolve(path2.dirname(basePath), "../../assets/init");
95
+ const baseDir = path2.dirname(basePath);
96
+ const candidates = [
97
+ path2.resolve(baseDir, "../../../assets/init"),
98
+ path2.resolve(baseDir, "../../assets/init")
99
+ ];
100
+ for (const candidate of candidates) {
101
+ if (existsSync(candidate)) {
102
+ return candidate;
103
+ }
104
+ }
105
+ throw new Error(
106
+ [
107
+ "init \u7528\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002Template assets not found.",
108
+ "\u78BA\u8A8D\u3057\u305F\u30D1\u30B9 / Checked paths:",
109
+ ...candidates.map((candidate) => `- ${candidate}`)
110
+ ].join("\n")
111
+ );
95
112
  }
96
113
 
97
114
  // src/cli/lib/logger.ts
@@ -676,8 +693,8 @@ import { readFile as readFile2 } from "fs/promises";
676
693
  import path7 from "path";
677
694
  import { fileURLToPath as fileURLToPath2 } from "url";
678
695
  async function resolveToolVersion() {
679
- if ("0.3.2".length > 0) {
680
- return "0.3.2";
696
+ if ("0.3.3".length > 0) {
697
+ return "0.3.3";
681
698
  }
682
699
  try {
683
700
  const packagePath = resolvePackageJsonPath();