Skip to content

Commit c738936

Browse files
committed
fix: m1 brew install
1 parent 832df69 commit c738936

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/vms/lima.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import BaseBackend from "./base";
22
import { ChildProcess } from "child_process";
33
import { LimaListResult } from "@/types/lima";
4+
import { isM1 } from "@/utils";
45
import { which } from "shelljs";
56

67
export default class LimaBackend extends BaseBackend {
78
async initVM(): Promise<boolean> {
89
if (!which("brew")) return false;
910
if (!which(this.vm)) {
10-
const child = (await this.exec(`brew install lima`)) as ChildProcess;
11+
const command = `${isM1 ? `arch -arm64 ` : ""}brew install lima`;
12+
const child = (await this.exec(command)) as ChildProcess;
1113
await new Promise((resolve, reject) => {
1214
child?.stdout?.on("data", (data) => {
1315
console.log(data);

0 commit comments

Comments
 (0)