From e511206bad9336e66debc6fdfe80b81e32509da1 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Thu, 25 Jan 2018 21:04:31 -0800 Subject: [PATCH] fix(installer): hdiutil output should be a string cross-spawn-promise returns stdout as a buffer. ISSUES CLOSED: #410 --- src/util/hdiutil.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/hdiutil.js b/src/util/hdiutil.js index 1878231d61..baabdc050c 100644 --- a/src/util/hdiutil.js +++ b/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 {