@quiteer/scripts 0.1.0 → 0.1.2

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.
Files changed (2) hide show
  1. package/dist/index.mjs +23 -10
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -12,7 +12,7 @@ import enquirer from "enquirer";
12
12
  import { versionBump } from "bumpp";
13
13
 
14
14
  //#region package.json
15
- var version = "0.1.0";
15
+ var version = "0.1.2";
16
16
 
17
17
  //#endregion
18
18
  //#region src/locales/changelog.ts
@@ -971,16 +971,29 @@ async function selfUpdate() {
971
971
  }
972
972
  console.info("quiteer-script :>> ", lightCyan(`开始更新到最新版本 ${latest}(当前 ${version})`));
973
973
  try {
974
- await execa("pnpm", [
975
- "add",
976
- "-g",
977
- `@quiteer/scripts@${latest}`
978
- ], { stdio: "inherit" });
979
- console.info("quiteer-script :>> ", lightGreen("更新完成,请重新运行命令"));
980
974
  if ((await getCurrentBinPath()).includes("node_modules/.bin")) {
981
- console.info("quiteer-script :>> ", lightBlue("当前命令来源于本地工作区,如需使用全局最新版本:"));
982
- console.info("quiteer-script :>> ", lightBlue("1) 退出当前仓库目录后执行 `qui`"));
983
- console.info("quiteer-script :>> ", lightBlue("2) 或使用临时执行:`pnpm dlx @quiteer/scripts <command>`"));
975
+ console.info("quiteer-script :>> ", lightBlue("检测到您正在开发环境中运行,将尝试通过本地构建更新..."));
976
+ await execa("pnpm", ["install"], { stdio: "inherit" });
977
+ await execa("pnpm", [
978
+ "--filter",
979
+ "@quiteer/scripts",
980
+ "build"
981
+ ], { stdio: "inherit" });
982
+ console.info("quiteer-script :>> ", lightGreen("本地构建完成,版本已同步"));
983
+ } else {
984
+ await execa("pnpm", [
985
+ "add",
986
+ "-g",
987
+ `@quiteer/scripts@${latest}`,
988
+ "--force"
989
+ ], { stdio: "inherit" });
990
+ console.info("quiteer-script :>> ", lightGreen("全局更新完成"));
991
+ try {
992
+ if (!(await execCommand("qui", ["-v"])).includes(latest)) {
993
+ console.info("quiteer-script :>> ", lightBlue("警告:检测到更新后版本号未变,可能是由于您的环境变量中存在多个 qui 路径。"));
994
+ console.info("quiteer-script :>> ", lightBlue(`请运行 ${lightGreen("which -a qui")} 检查是否存在路径冲突。`));
995
+ } else console.info("quiteer-script :>> ", lightGreen("验证成功:已更新至最新版本"));
996
+ } catch {}
984
997
  }
985
998
  } catch (e) {
986
999
  console.info("quiteer-script :>> ", lightBlue(`更新失败:${e?.message || "未知错误"}`));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quiteer/scripts",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "homepage": "https://quiteerjs.github.io/web/cli/scripts.html",
6
6
  "publishConfig": {
7
7
  "access": "public",