@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.
- package/dist/index.mjs +23 -10
- 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.
|
|
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
|
-
|
|
983
|
-
|
|
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 || "未知错误"}`));
|