@quiteer/scripts 0.1.2 → 0.1.4
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 +9 -9
- 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.4";
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/locales/changelog.ts
|
|
@@ -938,7 +938,7 @@ async function getCurrentBinPath() {
|
|
|
938
938
|
*/
|
|
939
939
|
async function checkUpdateAndNotify() {
|
|
940
940
|
try {
|
|
941
|
-
const latest = await execCommand("
|
|
941
|
+
const latest = await execCommand("npm", [
|
|
942
942
|
"view",
|
|
943
943
|
"@quiteer/scripts",
|
|
944
944
|
"version"
|
|
@@ -953,10 +953,10 @@ async function checkUpdateAndNotify() {
|
|
|
953
953
|
}
|
|
954
954
|
/**
|
|
955
955
|
* 自更新到最新版本
|
|
956
|
-
* - 对比当前版本与远端版本,不一致则使用
|
|
956
|
+
* - 对比当前版本与远端版本,不一致则使用 npm 全局更新
|
|
957
957
|
*/
|
|
958
958
|
async function selfUpdate() {
|
|
959
|
-
const latest = await execCommand("
|
|
959
|
+
const latest = await execCommand("npm", [
|
|
960
960
|
"view",
|
|
961
961
|
"@quiteer/scripts",
|
|
962
962
|
"version"
|
|
@@ -973,15 +973,15 @@ async function selfUpdate() {
|
|
|
973
973
|
try {
|
|
974
974
|
if ((await getCurrentBinPath()).includes("node_modules/.bin")) {
|
|
975
975
|
console.info("quiteer-script :>> ", lightBlue("检测到您正在开发环境中运行,将尝试通过本地构建更新..."));
|
|
976
|
-
await execa("
|
|
977
|
-
await execa("
|
|
976
|
+
await execa("npm", ["install"], { stdio: "inherit" });
|
|
977
|
+
await execa("npm", [
|
|
978
978
|
"--filter",
|
|
979
979
|
"@quiteer/scripts",
|
|
980
980
|
"build"
|
|
981
981
|
], { stdio: "inherit" });
|
|
982
982
|
console.info("quiteer-script :>> ", lightGreen("本地构建完成,版本已同步"));
|
|
983
983
|
} else {
|
|
984
|
-
await execa("
|
|
984
|
+
await execa("npm", [
|
|
985
985
|
"add",
|
|
986
986
|
"-g",
|
|
987
987
|
`@quiteer/scripts@${latest}`,
|
|
@@ -1025,8 +1025,8 @@ async function updatePkg(args = ["--deep", "-u"]) {
|
|
|
1025
1025
|
*/
|
|
1026
1026
|
function parseBranchToVersion(branch) {
|
|
1027
1027
|
if (!branch) return "";
|
|
1028
|
-
const match = branch.match(
|
|
1029
|
-
if (match && match[
|
|
1028
|
+
const match = branch.match(/(\d.*)$/);
|
|
1029
|
+
if (match && match[0]) return `v${match[0]}`;
|
|
1030
1030
|
return branch;
|
|
1031
1031
|
}
|
|
1032
1032
|
/**
|