mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-15 15:53:55 +00:00
update os.name() for freebsd
This commit is contained in:
@@ -1937,9 +1937,10 @@ void ILibDuktape_ScriptContainer_OS_Push(duk_context *ctx, void *chain)
|
||||
var p = new promise(function(acc, rej) { this._acc = acc; this._rej = rej; });\
|
||||
switch (process.platform)\
|
||||
{\
|
||||
case 'freebsd':\
|
||||
case 'linux':\
|
||||
case 'darwin':\
|
||||
p.child = require('child_process').execFile('/bin/sh', ['sh'], { type: require('child_process').SpawnTypes.TERM });\
|
||||
p.child = require('child_process').execFile('/bin/sh', ['sh']);\
|
||||
break;\
|
||||
case 'win32':\
|
||||
p.child = require('child_process').execFile('%windir%\\\\system32\\\\cmd.exe');\
|
||||
@@ -1982,6 +1983,9 @@ void ILibDuktape_ScriptContainer_OS_Push(duk_context *ctx, void *chain)
|
||||
}\
|
||||
this.promise._acc(OSNAME + ' ' + OSVERSION);\
|
||||
break;\
|
||||
case 'freebsd':\
|
||||
this.promise._acc(this.stdout.str.trim());\
|
||||
break;\
|
||||
}\
|
||||
});\
|
||||
switch (process.platform)\
|
||||
@@ -1995,6 +1999,9 @@ void ILibDuktape_ScriptContainer_OS_Push(duk_context *ctx, void *chain)
|
||||
case 'win32':\
|
||||
p.child.stdin.write('exit\\r\\n');\
|
||||
break;\
|
||||
case 'freebsd':\
|
||||
p.child.stdin.write('uname -mrs\\nexit\\n');\
|
||||
break;\
|
||||
}\
|
||||
return (p);\
|
||||
}";
|
||||
|
||||
Reference in New Issue
Block a user