Skip to content

Commit

Permalink
fix(win): cannot enable feature (#158)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Cui <[email protected]>
  • Loading branch information
BlackHole1 authored Jan 10, 2025
1 parent c1a61b4 commit 0f29d0e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,19 @@ export class RequestDarwin extends Request {
}

export class RequestWindows extends Request {
private readonly prepareSocketPath: string;
private readonly initSocketPath: string;

public constructor(name: string) {
super(`//./pipe/ovm-${name}`);
this.prepareSocketPath = `//./pipe/ovm-prepare-${name}`;
this.initSocketPath = `//./pipe/ovm-init-${name}`;
}

public async info(): Promise<OVMWindowsInfo> {
return JSON.parse(await this.do("info", Method.GET)) as OVMWindowsInfo;
}

public async enableFeature(): Promise<void> {
await this.do("enable-feature", Method.POST, NEVER_TIMEOUT, undefined, this.prepareSocketPath);
await this.do("enable-feature", Method.POST, NEVER_TIMEOUT, undefined, this.initSocketPath);
}

/**
Expand All @@ -193,10 +193,10 @@ export class RequestWindows extends Request {
await this.do("reboot", Method.POST, NEVER_TIMEOUT, {
runOnce,
later,
}, this.prepareSocketPath);
}, this.initSocketPath);
}

public async updateWSL(): Promise<void> {
await this.do("update-wsl", Method.PUT, NEVER_TIMEOUT, undefined, this.prepareSocketPath);
await this.do("update-wsl", Method.PUT, NEVER_TIMEOUT, undefined, this.initSocketPath);
}
}

0 comments on commit 0f29d0e

Please sign in to comment.