Incase package.json is removed, skip over version check.

This commit is contained in:
Pierce 2020-03-24 14:52:30 -04:00
parent cc9396a851
commit 4e9c2fbfb3
3 changed files with 5 additions and 3 deletions

View file

@ -182,7 +182,7 @@ You'll need to provide the folder created in the versions if you're running the
#### What should it look like running from console? #### What should it look like running from console?
The `pid` is printed in console after the process is launched. The `pid` is printed in console after the process is launched.
![gif](https://owo.whats-th.is/8mT5kxc.png/3N3PMC4.gif) ![gif](https://owo.whats-th.is/3N3PMC4.gif)
## Contributors ## Contributors
These are the people that helped out that aren't listed [here](https://github.com/Pierce01/MinecraftLauncher-core/graphs/contributors)! These are the people that helped out that aren't listed [here](https://github.com/Pierce01/MinecraftLauncher-core/graphs/contributors)!

View file

@ -28,7 +28,9 @@ class MCLCore extends EventEmitter {
// Lets the events register. our magic switch! // Lets the events register. our magic switch!
await void(0); await void(0);
this.emit('debug', `[MCLC]: MCLC version ${JSON.parse(fs.readFileSync(path.join(__dirname,'..', 'package.json'), { encoding: 'utf8' })).version}`); if(fs.existsSync(path.join(__dirname,'..', 'package.json'))) {
this.emit('debug', `[MCLC]: MCLC version ${JSON.parse(fs.readFileSync(path.join(__dirname,'..', 'package.json'), { encoding: 'utf8' })).version}`);
} else { this.emit('debug', `[MCLC]: Package JSON not found, skipping MCLC version check.`); }
const java = await this.handler.checkJava(this.options.javaPath || 'java'); const java = await this.handler.checkJava(this.options.javaPath || 'java');
if(!java.run) { if(!java.run) {
this.emit('debug', `[MCLC]: Couldn't start Minecraft due to: ${java.message}`); this.emit('debug', `[MCLC]: Couldn't start Minecraft due to: ${java.message}`);

View file

@ -1,6 +1,6 @@
{ {
"name": "minecraft-launcher-core", "name": "minecraft-launcher-core",
"version": "3.12.1", "version": "3.12.2",
"description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS", "description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {