chore: reformat all code with prettier

This commit is contained in:
modeco80
2024-04-24 03:50:17 -04:00
parent bcbf7db8d9
commit ddae307874
13 changed files with 1053 additions and 1074 deletions

View File

@@ -1,4 +1,4 @@
import { Size, Rect } from "@cvmts/shared";
import { Size, Rect } from '@cvmts/shared';
export function BatchRects(size: Size, rects: Array<Rect>): Rect {
var mergedX = size.width;
@@ -38,4 +38,4 @@ export function BatchRects(size: Size, rects: Array<Rect>): Rect {
width: mergedWidth,
height: mergedHeight
};
}
}

View File

@@ -30,8 +30,6 @@ const kMaxFailCount = 5;
// TODO: This should be added to QemuVmDefinition and the below export removed
let gVMShouldSnapshot = true;
export function setSnapshot(val: boolean) {
gVMShouldSnapshot = val;
}
@@ -68,10 +66,9 @@ export class QemuVM extends EventEmitter {
// build additional command line statements to enable qmp/vnc over unix sockets
// FIXME: Still use TCP if on Windows.
if(!this.addedAdditionalArguments) {
if (!this.addedAdditionalArguments) {
cmd += ' -no-shutdown';
if(gVMShouldSnapshot)
cmd += ' -snapshot';
if (gVMShouldSnapshot) cmd += ' -snapshot';
cmd += ` -qmp unix:${this.GetQmpPath()},server,wait -vnc unix:${this.GetVncPath()}`;
this.definition.command = cmd;
this.addedAdditionalArguments = true;
@@ -183,7 +180,7 @@ export class QemuVM extends EventEmitter {
if (self.qmpConnected) {
await self.DisconnectQmp();
}
self.DisconnectDisplay();
if (self.state != VMState.Stopping) {
@@ -275,16 +272,13 @@ export class QemuVM extends EventEmitter {
private async DisconnectQmp() {
if (this.qmpConnected) return;
if(this.qmpInstance == null)
return;
if (this.qmpInstance == null) return;
this.qmpConnected = false;
this.qmpInstance.end();
this.qmpInstance = null;
try {
await unlink(this.GetQmpPath());
} catch(err) {
}
} catch (err) {}
}
}

View File

@@ -76,7 +76,7 @@ export default class QmpClient extends Socket {
// just rethrow lol
//throw err;
console.log("you have pants: rules,", err);
console.log('you have pants: rules,', err);
});
this.once('data', (data) => {