Переглянути джерело

[create-stdf]Fix file path

杜府 3 роки тому
батько
коміт
41d295a819

+ 1 - 1
packages/create-stdf/package.json

@@ -1,6 +1,6 @@
 {
     "name": "create-stdf",
-    "version": "0.0.19",
+    "version": "0.0.20",
     "description": "A CLI for creating new STDF projects",
     "bin": {
         "create-stdf": "index.js"

+ 1 - 1
packages/create-stdf/src/index.js

@@ -110,7 +110,7 @@ templateOptions.forEach(async item => {
         fs.mkdirSync(projectDir);
         // 获取模板目录的绝对路径,考虑到 Windows 系统的兼容性, 使用 path.join
         // Get the absolute path of the template directory, considering the compatibility of the Windows system, use path.join
-        const templatePath = path.join(new URL(item.template, import.meta.url).pathname);
+        const templatePath = path.join(path.resolve(), '/create-stdf', item.template);
 
         // 将 templatePath 目录下的所有文件复制到 projectDir 目录下
         // Copy all files under the templatePath directory to the projectDir directory\