From 0ceb5d7fc3c7c56fd1c7cbaa1e349c59aba105fe Mon Sep 17 00:00:00 2001 From: v-zhangjc9 Date: Fri, 30 May 2025 10:29:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(bin):=20=E5=A2=9E=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=96=87=E4=BB=B6md5=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/library.js | 13 ++++++++----- bin/package.json | 1 + bin/pnpm-lock.yaml | 10 ++++++++++ bin/test.js | 6 ++++++ service-ai/bin/package.json | 1 + service-ai/bin/pnpm-lock.yaml | 10 ++++++++++ 6 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 bin/test.js diff --git a/bin/library.js b/bin/library.js index e06be2b..6e78385 100644 --- a/bin/library.js +++ b/bin/library.js @@ -1,5 +1,6 @@ import {$, fetch, fs, glob, os, path, spinner, syncProcessCwd, usePowerShell} from 'zx' -import {isEqual, trim} from "licia"; +import {isEqual, trim, fileSize} from "licia"; +import md5file from 'md5-file' syncProcessCwd(true) if (isEqual(os.platform(), 'win32')) { @@ -39,7 +40,7 @@ export const run_deploy = async (project) => { `Deploying project ${project}`, () => $`mvn -pl ${project} clean deploy -D skipTests -s ${maven_setting}` ) - console.log(`✅ Finish deploy ${project} (${millisecondToString(output['duration'])})`) + console.log(`✅ Finished deploy ${project} (${millisecondToString(output['duration'])})`) } export const run_deploy_root = async () => { @@ -47,7 +48,7 @@ export const run_deploy_root = async () => { `Deploying root`, () => $`mvn clean deploy -N -D skipTests -s ${maven_setting}` ) - console.log(`✅ Finish deploy root (${millisecondToString(output['duration'])})`) + console.log(`✅ Finished deploy root (${millisecondToString(output['duration'])})`) } export const run_deploy_batch = async (projects) => { @@ -61,7 +62,7 @@ export const run_package = async (project, profile = 'b2b12') => { `Packaging project ${project}${isEqual(profile, 'b2b12') ? '' : ` ${profile}`}`, () => $`mvn -pl ${project} clean package -D skipTests -P ${profile} -s ${maven_setting}` ) - console.log(`✅ Finish package ${project}${isEqual(profile, 'b2b12') ? '' : ` ${profile}`} (${millisecondToString(output['duration'])})`) + console.log(`✅ Finished package ${project}${isEqual(profile, 'b2b12') ? '' : ` ${profile}`} (${millisecondToString(output['duration'])})`) } export const run_package_batch = async (projects) => { @@ -88,7 +89,9 @@ const upload = async (file_path) => { if (!isEqual(response.status, 200)) { throw response } - console.log(`✅ Finish upload ${file_path} (${millisecondToString((new Date().getTime()) - start)})`) + console.log(`✅ Finished upload ${file_path} (${millisecondToString((new Date().getTime()) - start)})`) + console.log(`📘 Uploaded ${fileSize(fs.statSync(file_path).size)}`) + console.log(`📘 MD5 ${md5file.sync(file_path)}`) fs.rmSync(file_path) } diff --git a/bin/package.json b/bin/package.json index 5051488..9cb6198 100644 --- a/bin/package.json +++ b/bin/package.json @@ -9,6 +9,7 @@ "fs-extra": "^11.3.0", "globby": "^14.1.0", "licia": "^1.48.0", + "md5-file": "^5.0.0", "minimist": "^1.2.8", "node-fetch-native": "^1.6.6", "which": "^5.0.0", diff --git a/bin/pnpm-lock.yaml b/bin/pnpm-lock.yaml index 9d94b3e..dd22656 100644 --- a/bin/pnpm-lock.yaml +++ b/bin/pnpm-lock.yaml @@ -26,6 +26,9 @@ importers: licia: specifier: ^1.48.0 version: 1.48.0 + md5-file: + specifier: ^5.0.0 + version: 5.0.0 minimist: specifier: ^1.2.8 version: 1.2.8 @@ -129,6 +132,11 @@ packages: licia@1.48.0: resolution: {integrity: sha512-bBWiT5CSdEtwuAHiYTJ74yItCjIFdHi4xiFk6BRDfKa+sdCpkUHp69YKb5udNOJlHDzFjNjcMgNZ/+wQIHrB8A==} + md5-file@5.0.0: + resolution: {integrity: sha512-xbEFXCYVWrSx/gEKS1VPlg84h/4L20znVIulKw6kMfmBUAZNAnF00eczz9ICMl+/hjQGo5KSXRxbL/47X3rmMw==} + engines: {node: '>=10.13.0'} + hasBin: true + merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -283,6 +291,8 @@ snapshots: licia@1.48.0: {} + md5-file@5.0.0: {} + merge2@1.4.1: {} micromatch@4.0.8: diff --git a/bin/test.js b/bin/test.js new file mode 100644 index 0000000..39ab1b7 --- /dev/null +++ b/bin/test.js @@ -0,0 +1,6 @@ +import {fs} from 'zx' + +let stats = fs.statSync('/Users/lanyuanxiaoyao/Project/IdeaProjects/hudi-service/service-api'); +console.log(stats.ctime) +console.log(stats.atime) +console.log(stats.mtime) \ No newline at end of file diff --git a/service-ai/bin/package.json b/service-ai/bin/package.json index 5051488..9cb6198 100644 --- a/service-ai/bin/package.json +++ b/service-ai/bin/package.json @@ -9,6 +9,7 @@ "fs-extra": "^11.3.0", "globby": "^14.1.0", "licia": "^1.48.0", + "md5-file": "^5.0.0", "minimist": "^1.2.8", "node-fetch-native": "^1.6.6", "which": "^5.0.0", diff --git a/service-ai/bin/pnpm-lock.yaml b/service-ai/bin/pnpm-lock.yaml index 9d94b3e..dd22656 100644 --- a/service-ai/bin/pnpm-lock.yaml +++ b/service-ai/bin/pnpm-lock.yaml @@ -26,6 +26,9 @@ importers: licia: specifier: ^1.48.0 version: 1.48.0 + md5-file: + specifier: ^5.0.0 + version: 5.0.0 minimist: specifier: ^1.2.8 version: 1.2.8 @@ -129,6 +132,11 @@ packages: licia@1.48.0: resolution: {integrity: sha512-bBWiT5CSdEtwuAHiYTJ74yItCjIFdHi4xiFk6BRDfKa+sdCpkUHp69YKb5udNOJlHDzFjNjcMgNZ/+wQIHrB8A==} + md5-file@5.0.0: + resolution: {integrity: sha512-xbEFXCYVWrSx/gEKS1VPlg84h/4L20znVIulKw6kMfmBUAZNAnF00eczz9ICMl+/hjQGo5KSXRxbL/47X3rmMw==} + engines: {node: '>=10.13.0'} + hasBin: true + merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -283,6 +291,8 @@ snapshots: licia@1.48.0: {} + md5-file@5.0.0: {} + merge2@1.4.1: {} micromatch@4.0.8: