fix(bin): 优化打包脚本

This commit is contained in:
v-zhangjc9
2025-06-04 10:02:25 +08:00
parent 1217d114bd
commit fdec62b56e
5 changed files with 19 additions and 51 deletions

View File

@@ -14,6 +14,12 @@ const upload_url = 'http://132.126.207.124:36800'
const upload_username = 'AxhEbscwsJDbYMH2'
const upload_password = 'cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4'
/**
* 时间戳转自然语言
*
* @param timestamp 时间戳
* @returns {string} 自然语言描述的时间
*/
const millisecondToString = (timestamp) => {
const totalSeconds = Math.floor(parseFloat(timestamp) / 1000)
if (isNaN(totalSeconds) || totalSeconds < 0) {
@@ -91,8 +97,8 @@ const upload = async (file_path) => {
throw response
}
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)}`)
console.log(`📘 Uploaded ${fileSize(fs.statSync(file_path).size)}`)
console.log(`📘 MD5 ${md5file.sync(file_path)}`)
fs.rmSync(file_path)
}