Skip to content

Commit f7e0d48

Browse files
committed
opt: use chmod from libc
1 parent bb7e6c3 commit f7e0d48

File tree

4 files changed

+4
-67
lines changed

4 files changed

+4
-67
lines changed

Editor/Shell.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public static ShellRequest RunCommand(string cmd, ShellSettings? settings = defa
197197
File.Move(tempFile, cmdFile);
198198
File.WriteAllText(cmdFile, finalCmd);
199199
#if UNITY_EDITOR_LINUX || UNITY_EDITOR_OSX
200-
var ret = os_chmod(cmdFile, 511);
200+
var ret = chmod(cmdFile, 511);
201201
var p = CreateProcess("bash", workDirectory, environ, cmdFile);
202202
#else
203203
var p = CreateProcess(cmdFile, workDirectory, environ);
@@ -277,8 +277,8 @@ static ShellRequest QueueUpProcess(Process p, string cmd, ShellSettings settings
277277

278278

279279
#region external stubs
280-
[DllImport("libOS.so", EntryPoint = "os_chmod")]
281-
extern static int os_chmod(string path, int mode);
280+
[DllImport("libc")]
281+
extern static int chmod(string path, int mode);
282282
#endregion
283283
}
284284

Editor/libOS.dylib

-48.2 KB
Binary file not shown.

Editor/libOS.dylib.meta

-63
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "com.bbbirder.shell",
33
"displayName": "shell",
44
"description": "run shell in unity editor",
5-
"version": "1.1.8",
5+
"version": "1.1.9",
66
"hideInEditor": false,
77
"scripts": {},
88
"author": "bbbirder <[email protected]>",

0 commit comments

Comments
 (0)