Removing existing aliases before creating a new alias

This commit is contained in:
Lulu 2024-01-29 22:35:24 +00:00
parent 4f18ec9fb1
commit 1cfb3bae72
3 changed files with 15 additions and 1 deletions

6
dist/index.js generated vendored
View File

@ -207,12 +207,18 @@ function run(platform) {
// Create symlink to Godot executable
const godotAlias = path_1.default.join(binDir, 'godot');
core.startGroup(`🔗 Creating symlinks to executables...`);
// If an alias already exists, remove it before creating the new alias
if (fs.existsSync(godotAlias))
fs.unlinkSync(godotAlias);
fs.linkSync(godotExecutable, godotAlias);
core.info(`✅ Symlink to Godot created`);
const godotSharpDirAlias = path_1.default.join(binDir, 'GodotSharp');
if (useDotnet) {
// Create symlink to GodotSharp directory
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);
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

@ -259,12 +259,20 @@ async function run(platform: Platform): Promise<void> {
// Create symlink to Godot executable
const godotAlias = path.join(binDir, 'godot')
core.startGroup(`🔗 Creating symlinks to executables...`)
// If an alias already exists, remove it before creating the new alias
if (fs.existsSync(godotAlias)) fs.unlinkSync(godotAlias)
fs.linkSync(godotExecutable, godotAlias)
core.info(`✅ Symlink to Godot created`)
const godotSharpDirAlias = path.join(binDir, 'GodotSharp')
if (useDotnet) {
// Create symlink to GodotSharp directory
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)
core.info(`✅ Symlink to GodotSharp created at ${godotSharpDirAlias}`)
}