mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-16 08:13:30 +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; });\
|
var p = new promise(function(acc, rej) { this._acc = acc; this._rej = rej; });\
|
||||||
switch (process.platform)\
|
switch (process.platform)\
|
||||||
{\
|
{\
|
||||||
|
case 'freebsd':\
|
||||||
case 'linux':\
|
case 'linux':\
|
||||||
case 'darwin':\
|
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;\
|
break;\
|
||||||
case 'win32':\
|
case 'win32':\
|
||||||
p.child = require('child_process').execFile('%windir%\\\\system32\\\\cmd.exe');\
|
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);\
|
this.promise._acc(OSNAME + ' ' + OSVERSION);\
|
||||||
break;\
|
break;\
|
||||||
|
case 'freebsd':\
|
||||||
|
this.promise._acc(this.stdout.str.trim());\
|
||||||
|
break;\
|
||||||
}\
|
}\
|
||||||
});\
|
});\
|
||||||
switch (process.platform)\
|
switch (process.platform)\
|
||||||
@@ -1995,6 +1999,9 @@ void ILibDuktape_ScriptContainer_OS_Push(duk_context *ctx, void *chain)
|
|||||||
case 'win32':\
|
case 'win32':\
|
||||||
p.child.stdin.write('exit\\r\\n');\
|
p.child.stdin.write('exit\\r\\n');\
|
||||||
break;\
|
break;\
|
||||||
|
case 'freebsd':\
|
||||||
|
p.child.stdin.write('uname -mrs\\nexit\\n');\
|
||||||
|
break;\
|
||||||
}\
|
}\
|
||||||
return (p);\
|
return (p);\
|
||||||
}";
|
}";
|
||||||
|
|||||||
Reference in New Issue
Block a user