build-strap 5.0.4-dev.105 → 5.0.4-dev.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/macos.d.ts +1 -0
- package/src/macos.js +12 -0
package/package.json
CHANGED
package/src/macos.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const mountDmg: (dmgPath: string, mountPath: string) => Promise<void>;
|
|
2
2
|
export declare const unmountDmg: (mountPath: string) => Promise<void>;
|
|
3
3
|
export declare const ensureXcodeCmdInstalled: (ignoreNonMac?: boolean) => Promise<void>;
|
|
4
|
+
export declare const ensureRosettaInstalled: (ignoreNonMac?: boolean) => Promise<void>;
|
package/src/macos.js
CHANGED
|
@@ -34,3 +34,15 @@ export const ensureXcodeCmdInstalled = async (ignoreNonMac = true) => {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
+
export const ensureRosettaInstalled = async (ignoreNonMac = true) => {
|
|
38
|
+
if (!isMac()) {
|
|
39
|
+
if (!ignoreNonMac) {
|
|
40
|
+
throw new Error('Cannot install Rosetta on non-macOS');
|
|
41
|
+
}
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (!(await fs.pathExists('/usr/libexec/rosetta'))) {
|
|
45
|
+
buildLog('Installing Rosetta...');
|
|
46
|
+
await spawn('softwareupdate', ['--install-rosetta', '--agree-to-license']);
|
|
47
|
+
}
|
|
48
|
+
};
|