-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Now supports all versions of Discord on Windows - Less loops to find the process name - Cleaned up lots of redundant code
- Loading branch information
Showing
7 changed files
with
114 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const fetch = require('node-fetch'); | ||
const findProcess = require('find-process'); | ||
const EventEmitter = require('events'); | ||
const os = require('os'); | ||
|
||
class System { | ||
constructor(){ | ||
this.os = { | ||
name: os.platform(), | ||
isWindows: os.platform() === 'win32', | ||
isMacOS: os.platform() === 'darwin', | ||
splitter: os.platform() === 'darwin' ? '/' : `\\` | ||
}; | ||
} | ||
|
||
async processExists(wildcard, processes = false){ | ||
return new Promise((resolve, reject) => { | ||
if(!processes) processes = [wildcard]; | ||
else if(!Array.isArray(processes)) processes = [processes]; | ||
|
||
findProcess('name', wildcard).then(list => { | ||
resolve(list.filter(l => processes.includes(l.name)).length > 0); | ||
}); | ||
}); | ||
} | ||
} | ||
|
||
module.exports = new System(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters