update
This commit is contained in:
@@ -171,7 +171,7 @@ const uploadFiles = async (files: string[], directory: string, opts: UploadFileO
|
||||
logger.error('请检查文件是否存在');
|
||||
}
|
||||
data.files.push({ path: file, hash: hash });
|
||||
if(filePath.includes('readme.md')) {
|
||||
if (filePath.includes('readme.md')) {
|
||||
description = fs.readFileSync(filePath, 'utf-8');
|
||||
}
|
||||
}
|
||||
@@ -215,8 +215,10 @@ const uploadFiles = async (files: string[], directory: string, opts: UploadFileO
|
||||
}
|
||||
const filename = path.basename(filePath);
|
||||
logger.debug('upload file', file, filename);
|
||||
// 解决 busbox 文件名乱码: 将 UTF-8 编码的文件名转换为 binary 字符串
|
||||
const encodedFilename = Buffer.from(filename, 'utf-8').toString('binary');
|
||||
form.append('file', fs.createReadStream(filePath), {
|
||||
filename: filename,
|
||||
filename: encodedFilename,
|
||||
filepath: file,
|
||||
});
|
||||
needUpload = true;
|
||||
|
||||
Reference in New Issue
Block a user