feat(bin): 优化上传命令

This commit is contained in:
v-zhangjc9
2025-05-29 11:15:04 +08:00
parent 0262c573ae
commit 0f49c91fde

View File

@@ -71,6 +71,7 @@ export const run_package_batch = async (projects) => {
}
const upload = async (file_path) => {
let start = new Date().getTime()
let response = await spinner(
`Uploading project ${file_path}`,
() => fetch(`${upload_url}/file/upload/${path.basename(file_path)}`, {
@@ -87,7 +88,7 @@ const upload = async (file_path) => {
if (!isEqual(response.status, 200)) {
throw response
}
console.log(`✅ Finish upload ${file_path}`)
console.log(`✅ Finish upload ${file_path} (${millisecondToString((new Date().getTime()) - start)})`)
fs.rmSync(file_path)
}