Remove bin directory before creating aliases

This commit is contained in:
Lulu 2024-01-30 00:18:28 +00:00
parent 1dbe5d2878
commit 0c73ef0c02
3 changed files with 4 additions and 11 deletions

7
dist/index.js generated vendored
View File

@ -214,17 +214,14 @@ function run(platform) {
const godotAlias = path_1.default.join(binDir, 'godot'); const godotAlias = path_1.default.join(binDir, 'godot');
core.startGroup(`🔗 Creating symlinks to executables...`); core.startGroup(`🔗 Creating symlinks to executables...`);
// If an alias already exists, remove it before creating the new alias // If an alias already exists, remove it before creating the new alias
if (fs.existsSync(godotAlias)) if (fs.existsSync(binDir))
fs.unlinkSync(godotAlias); fs.rmSync(binDir, { recursive: true, force: true });
fs.linkSync(godotExecutable, godotAlias); fs.linkSync(godotExecutable, godotAlias);
core.info(`✅ Symlink to Godot created`); core.info(`✅ Symlink to Godot created`);
const godotSharpDirAlias = path_1.default.join(binDir, 'GodotSharp'); const godotSharpDirAlias = path_1.default.join(binDir, 'GodotSharp');
if (useDotnet) { if (useDotnet) {
// Create symlink to GodotSharp directory // Create symlink to GodotSharp directory
const godotSharpDir = path_1.default.join(path_1.default.dirname(godotSharp), '../..'); const godotSharpDir = path_1.default.join(path_1.default.dirname(godotSharp), '../..');
// If an alias already exists, remove it before creating the new alias
if (fs.existsSync(godotSharpDirAlias))
fs.unlinkSync(godotSharpDirAlias);
fs.symlinkSync(godotSharpDir, godotSharpDirAlias); fs.symlinkSync(godotSharpDir, godotSharpDirAlias);
core.info(`✅ Symlink to GodotSharp created at ${godotSharpDirAlias}`); core.info(`✅ Symlink to GodotSharp created at ${godotSharpDirAlias}`);
} }

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -271,7 +271,7 @@ async function run(platform: Platform): Promise<void> {
core.startGroup(`🔗 Creating symlinks to executables...`) core.startGroup(`🔗 Creating symlinks to executables...`)
// If an alias already exists, remove it before creating the new alias // If an alias already exists, remove it before creating the new alias
if (fs.existsSync(godotAlias)) fs.unlinkSync(godotAlias) if (fs.existsSync(binDir)) fs.rmSync(binDir, {recursive: true, force: true})
fs.linkSync(godotExecutable, godotAlias) fs.linkSync(godotExecutable, godotAlias)
core.info(`✅ Symlink to Godot created`) core.info(`✅ Symlink to Godot created`)
@ -279,10 +279,6 @@ async function run(platform: Platform): Promise<void> {
if (useDotnet) { if (useDotnet) {
// Create symlink to GodotSharp directory // Create symlink to GodotSharp directory
const godotSharpDir = path.join(path.dirname(godotSharp), '../..') const godotSharpDir = path.join(path.dirname(godotSharp), '../..')
// If an alias already exists, remove it before creating the new alias
if (fs.existsSync(godotSharpDirAlias)) fs.unlinkSync(godotSharpDirAlias)
fs.symlinkSync(godotSharpDir, godotSharpDirAlias) fs.symlinkSync(godotSharpDir, godotSharpDirAlias)
core.info(`✅ Symlink to GodotSharp created at ${godotSharpDirAlias}`) core.info(`✅ Symlink to GodotSharp created at ${godotSharpDirAlias}`)
} }