Skip to content
Permalink
Browse files

fix(installer): hdiutil output should be a string

cross-spawn-promise returns stdout as a buffer.

ISSUES CLOSED: #410
  • Loading branch information
malept committed Jan 26, 2018
1 parent 674e6c4 commit e511206bad9336e66debc6fdfe80b81e32509da1
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/util/hdiutil.js
@@ -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 = [];
@@ -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 {

0 comments on commit e511206

Please sign in to comment.
You can’t perform that action at this time.