mirror of
https://github.com/chickensoft-games/setup-godot.git
synced 2025-08-14 21:05:06 +00:00
Removing existing installations before extracting downloaded ZIP
This commit is contained in:
parent
1cfb3bae72
commit
0fb1a0852c
6
dist/index.js
generated
vendored
6
dist/index.js
generated
vendored
@ -140,6 +140,9 @@ function run(platform) {
|
|||||||
core.endGroup();
|
core.endGroup();
|
||||||
// Extract Godot
|
// Extract Godot
|
||||||
core.startGroup(`📦 Extracting Godot to ${installationDir}...`);
|
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);
|
||||||
const godotExtractedPath = yield toolsCache.extractZip(godotDownloadedPath, installationDir);
|
const godotExtractedPath = yield toolsCache.extractZip(godotDownloadedPath, installationDir);
|
||||||
core.info(`✅ Godot extracted to ${godotExtractedPath}`);
|
core.info(`✅ Godot extracted to ${godotExtractedPath}`);
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
@ -149,6 +152,9 @@ function run(platform) {
|
|||||||
core.info(`✅ Files shown`);
|
core.info(`✅ Files shown`);
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
core.startGroup(`📦 Extracting Export Templates to ${exportTemplatePath}...`);
|
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);
|
||||||
const exportTemplateExtractedPath = yield toolsCache.extractZip(templateDownloadedPath, path_1.default.dirname(exportTemplatePath));
|
const exportTemplateExtractedPath = yield toolsCache.extractZip(templateDownloadedPath, path_1.default.dirname(exportTemplatePath));
|
||||||
core.info(`✅ Export Templates extracted to ${exportTemplateExtractedPath}`);
|
core.info(`✅ Export Templates extracted to ${exportTemplateExtractedPath}`);
|
||||||
fs.renameSync(path_1.default.join(exportTemplateExtractedPath, 'templates'), exportTemplatePath);
|
fs.renameSync(path_1.default.join(exportTemplateExtractedPath, 'templates'), exportTemplatePath);
|
||||||
|
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@ -148,6 +148,10 @@ async function run(platform: Platform): Promise<void> {
|
|||||||
|
|
||||||
// Extract Godot
|
// Extract Godot
|
||||||
core.startGroup(`📦 Extracting Godot to ${installationDir}...`)
|
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)
|
||||||
|
|
||||||
const godotExtractedPath = await toolsCache.extractZip(
|
const godotExtractedPath = await toolsCache.extractZip(
|
||||||
godotDownloadedPath,
|
godotDownloadedPath,
|
||||||
installationDir
|
installationDir
|
||||||
@ -168,6 +172,10 @@ async function run(platform: Platform): Promise<void> {
|
|||||||
core.startGroup(
|
core.startGroup(
|
||||||
`📦 Extracting Export Templates to ${exportTemplatePath}...`
|
`📦 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)
|
||||||
|
|
||||||
const exportTemplateExtractedPath = await toolsCache.extractZip(
|
const exportTemplateExtractedPath = await toolsCache.extractZip(
|
||||||
templateDownloadedPath,
|
templateDownloadedPath,
|
||||||
path.dirname(exportTemplatePath)
|
path.dirname(exportTemplatePath)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user