File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
3+ const os = require ( 'os' ) ;
4+ const path = require ( 'path' ) ;
35const net = require ( 'net' ) ;
46const EventEmitter = require ( 'events' ) ;
57const fetch = require ( 'node-fetch' ) ;
@@ -17,6 +19,15 @@ function getIPCPath(id) {
1719 if ( process . platform === 'win32' ) {
1820 return `\\\\?\\pipe\\discord-ipc-${ id } ` ;
1921 }
22+
23+ if ( process . platform === 'darwin' ) {
24+ let tmpdir = os . tmpdir ( ) ;
25+ if ( ! tmpdir . endsWith ( '/T' ) ) {
26+ tmpdir = path . dirname ( tmpdir ) ;
27+ }
28+ return `${ tmpdir } /discord-ipc-${ id } ` ;
29+ }
30+
2031 const { env : { XDG_RUNTIME_DIR , TMPDIR , TMP , TEMP } } = process ;
2132 const prefix = XDG_RUNTIME_DIR || TMPDIR || TMP || TEMP || '/tmp' ;
2233 return `${ prefix . replace ( / \/ $ / , '' ) } /discord-ipc-${ id } ` ;
You can’t perform that action at this time.
0 commit comments