Skip to content

Commit 92cdaf8

Browse files
authored
MacOS Godot executable killed by Kernel (Killed: 9) (#101)
* ln test * final
1 parent fe568fa commit 92cdaf8

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

dist/index.js

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import * as core from '@actions/core'
33
import * as toolsCache from '@actions/tool-cache'
44
import * as fs from 'fs'
55
import * as os from 'os'
6+
import * as child_process from 'child_process'
7+
import * as process from 'process'
68
import path from 'path'
79

810
import {
@@ -295,7 +297,15 @@ async function run(platform: Platform): Promise<void> {
295297
fs.mkdirSync(binDir, {recursive: true})
296298
}
297299

298-
fs.linkSync(godotExecutable, godotAlias)
300+
// `fs.linkSync` has some issues on macOS for Godot executable
301+
// it does not create symlink at all, it copies whole file
302+
// and corrupts it a way that Godot gets killed by kernel (Killed: 9)
303+
if (process.platform === "darwin") {
304+
child_process.execSync(`ln -s "${godotExecutable}" "${godotAlias}"`)
305+
} else {
306+
fs.linkSync(godotExecutable, godotAlias)
307+
}
308+
299309
core.info(`✅ Symlink to Godot created`)
300310
const godotSharpDirAlias = path.join(binDir, 'GodotSharp')
301311
if (useDotnet) {

0 commit comments

Comments
 (0)