Thienvv - xóa file nén cũ trước khi nén file mới

This commit is contained in:
thienqb123456
2025-01-06 10:00:55 +07:00
parent b9860438da
commit 16a903b943
4 changed files with 29 additions and 1 deletions
@@ -196,6 +196,13 @@ void buildProject(String buildFolderPath, String command) {
void compressItems(String compressedFilePath, String parentFolderPath) {
echo "Starting compression of the entire folder into a zip file : ${compressedFilePath}"
try {
if (fileExists(compressedFilePath)) {
echo "Old ZIP file exists. Deleting: ${compressedFilePath}"
sh "rm -f ${compressedFilePath}"
} else {
echo 'No old ZIP file found.'
}
if (!fileExists(parentFolderPath)) {
error "parentFolderPath is not exist : ${parentFolderPath}"
}
@@ -199,6 +199,13 @@ void buildProject(String buildFolderPath, String command) {
void compressItems(String compressedFilePath, String parentFolderPath) {
echo "Starting compression of the entire folder into a zip file : ${compressedFilePath}"
try {
if (fileExists(compressedFilePath)) {
echo "Old ZIP file exists. Deleting: ${compressedFilePath}"
sh "rm -f ${compressedFilePath}"
} else {
echo 'No old ZIP file found.'
}
if (!fileExists(parentFolderPath)) {
error "parentFolderPath is not exist : ${parentFolderPath}"
}