@fxri/swagger2api 1.0.8 → 1.0.9

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.
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ import axios from "axios";
2
2
  import { execSync } from "node:child_process";
3
3
  import os from "node:os";
4
4
  import fs from "node:fs";
5
+ import url from "node:url";
5
6
  import path from "node:path";
6
7
  import prompts from "prompts";
7
8
  import { getParam, isUrl, saveFile } from "./utils/index.js";
@@ -32,7 +33,7 @@ let datas = {
32
33
  /** 用户目录 */
33
34
  home: os.homedir(),
34
35
  /** 脚本 */
35
- script: path.resolve(import.meta.dirname, "../node_modules/.bin/swagger-typescript-api"),
36
+ script: path.resolve(path.dirname(url.fileURLToPath(import.meta.url)), "../node_modules/.bin/swagger-typescript-api"),
36
37
  /** 参数 */
37
38
  param: process.argv.filter((_item, index) => index > 1),
38
39
  /** 文件 */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fxri/swagger2api",
3
- "version": "1.0.8",
4
- "description": "基于 swagger-typescript-api,将 Swagger 文档自动转为 TypeScript 格式的 API 文件",
3
+ "version": "1.0.9",
4
+ "description": "基于 swagger-typescript-api,将 Swagger 文档自动转为 TypeScript 格式的 API 文件。",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "唐启云",