dowload package

This commit is contained in:
2026-06-02 09:22:24 +07:00
parent 9cedf085a3
commit e7dce2f0e9
4 changed files with 18 additions and 1 deletions

View File

@@ -1067,7 +1067,13 @@ function getLocalPackageFilePath(filePath) {
function getDownloadFileName(packageVersion, localPath) {
const storedName = path.basename(localPath || '');
if (storedName) return storedName.replace(/"/g, '');
if (storedName) {
const uploadedName = storedName
.replace(/"/g, '')
.replace(/^\d+-[a-f0-9]{8}-/, '');
if (uploadedName) return uploadedName;
}
const packageCode = String(packageVersion.packageCode || 'package').replace(/[^a-zA-Z0-9._+-]/g, '-');
const version = String(packageVersion.version || 'latest').replace(/[^a-zA-Z0-9._:+~=-]/g, '-');