Removing downloaded ZIP before downloading another version

This commit is contained in:
Lulu 2024-01-29 22:33:25 +00:00
parent 1af6893043
commit 4f18ec9fb1
3 changed files with 16 additions and 1 deletions

6
dist/index.js generated vendored
View File

@ -125,10 +125,16 @@ function run(platform) {
core.info(`🙃 Previous Godot download not found in cache`);
core.endGroup();
core.startGroup(`📥 Downloading Godot to ${godotDownloadPath}...`);
// If the ZIP file still exists locally, delete it before downloading
if (fs.existsSync(godotDownloadPath))
fs.rmSync(godotDownloadPath);
const godotDownloadedPath = yield toolsCache.downloadTool(godotUrl, godotDownloadPath);
core.info(`✅ Godot downloaded to ${godotDownloadedPath}`);
core.endGroup();
core.startGroup(`📥 Downloading Export Templates to ${exportTemplateDownloadPath}...`);
// If the ZIP file still exists locally, delete it before downloading
if (fs.existsSync(exportTemplateDownloadPath))
fs.rmSync(exportTemplateDownloadPath);
const templateDownloadedPath = yield toolsCache.downloadTool(exportTemplateUrl, exportTemplateDownloadPath);
core.info(`✅ Export Templates downloaded to ${templateDownloadedPath}`);
core.endGroup();

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -120,6 +120,10 @@ async function run(platform: Platform): Promise<void> {
core.endGroup()
core.startGroup(`📥 Downloading Godot to ${godotDownloadPath}...`)
// If the ZIP file still exists locally, delete it before downloading
if (fs.existsSync(godotDownloadPath)) fs.rmSync(godotDownloadPath)
const godotDownloadedPath = await toolsCache.downloadTool(
godotUrl,
godotDownloadPath
@ -130,6 +134,11 @@ async function run(platform: Platform): Promise<void> {
core.startGroup(
`📥 Downloading Export Templates to ${exportTemplateDownloadPath}...`
)
// If the ZIP file still exists locally, delete it before downloading
if (fs.existsSync(exportTemplateDownloadPath))
fs.rmSync(exportTemplateDownloadPath)
const templateDownloadedPath = await toolsCache.downloadTool(
exportTemplateUrl,
exportTemplateDownloadPath