Skip to content

Commit d58b029

Browse files
committed
fix(installer): hdiutil output should be a string
cross-spawn-promise returns stdout as a buffer. ISSUES CLOSED: #410
1 parent 6e93e29 commit d58b029

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/util/hdiutil.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const d = debug('electron-forge:hdiutil');
55

66
export const getMountedImages = async () => {
77
const output = await spawnPromise('hdiutil', ['info']);
8-
const mounts = output.split(/====\n/g);
8+
const mounts = output.toString().split(/====\n/g);
99
mounts.shift();
1010

1111
const mountObjects = [];
@@ -26,8 +26,8 @@ export const getMountedImages = async () => {
2626

2727
export const mountImage = async (filePath) => {
2828
d('mounting image:', filePath);
29-
const output = await spawnPromise('hdiutil', ['attach', '-noautoopen', '-nobrowse', '-noverify', filePath]).toString();
30-
const mountPath = /\/Volumes\/(.+)\n/g.exec(output)[1];
29+
const output = await spawnPromise('hdiutil', ['attach', '-noautoopen', '-nobrowse', '-noverify', filePath]);
30+
const mountPath = /\/Volumes\/(.+)\n/g.exec(output.toString())[1];
3131
d('mounted at:', mountPath);
3232

3333
return {

0 commit comments

Comments
 (0)