Skip to content

Commit

Permalink
fix(installer): hdiutil output should be a string
Browse files Browse the repository at this point in the history
cross-spawn-promise returns stdout as a buffer.

ISSUES CLOSED: #410
  • Loading branch information
malept committed Jan 29, 2018
1 parent 674e6c4 commit e511206
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util/hdiutil.js
Expand Up @@ -5,7 +5,7 @@ const d = debug('electron-forge:hdiutil');

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

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

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

return {
Expand Down

0 comments on commit e511206

Please sign in to comment.