Removing existing installations recursively

This commit is contained in:
Lulu 2024-01-29 23:23:48 +00:00
parent 0fb1a0852c
commit 1dbe5d2878
3 changed files with 7 additions and 5 deletions

4
dist/index.js generated vendored
View File

@ -142,7 +142,7 @@ function run(platform) {
core.startGroup(`📦 Extracting Godot to ${installationDir}...`);
// If the export template folder already exists, remove it before extracting the ZIP file. This will "uninstall" other installations (e.g. on version changes).
if (fs.existsSync(installationDir))
fs.rmdirSync(installationDir);
fs.rmdirSync(installationDir, { recursive: true });
const godotExtractedPath = yield toolsCache.extractZip(godotDownloadedPath, installationDir);
core.info(`✅ Godot extracted to ${godotExtractedPath}`);
core.endGroup();
@ -154,7 +154,7 @@ function run(platform) {
core.startGroup(`📦 Extracting Export Templates to ${exportTemplatePath}...`);
// If the export template folder already exists, remove it before extracting the ZIP file. This will "uninstall" other installations (e.g. on version changes).
if (fs.existsSync(exportTemplatePath))
fs.rmdirSync(exportTemplatePath);
fs.rmdirSync(exportTemplatePath, { recursive: true });
const exportTemplateExtractedPath = yield toolsCache.extractZip(templateDownloadedPath, path_1.default.dirname(exportTemplatePath));
core.info(`✅ Export Templates extracted to ${exportTemplateExtractedPath}`);
fs.renameSync(path_1.default.join(exportTemplateExtractedPath, 'templates'), exportTemplatePath);

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -150,7 +150,8 @@ async function run(platform: Platform): Promise<void> {
core.startGroup(`📦 Extracting Godot to ${installationDir}...`)
// If the export template folder already exists, remove it before extracting the ZIP file. This will "uninstall" other installations (e.g. on version changes).
if (fs.existsSync(installationDir)) fs.rmdirSync(installationDir)
if (fs.existsSync(installationDir))
fs.rmdirSync(installationDir, {recursive: true})
const godotExtractedPath = await toolsCache.extractZip(
godotDownloadedPath,
@ -174,7 +175,8 @@ async function run(platform: Platform): Promise<void> {
)
// If the export template folder already exists, remove it before extracting the ZIP file. This will "uninstall" other installations (e.g. on version changes).
if (fs.existsSync(exportTemplatePath)) fs.rmdirSync(exportTemplatePath)
if (fs.existsSync(exportTemplatePath))
fs.rmdirSync(exportTemplatePath, {recursive: true})
const exportTemplateExtractedPath = await toolsCache.extractZip(
templateDownloadedPath,