From 8edd8ac73a47898688ce828ba1d493895739152b Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Thu, 23 Jun 2016 23:55:36 -0700 Subject: [PATCH] Support macOS in automatic deployment --- cmds/cmds.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmds/cmds.ts b/cmds/cmds.ts index 2bfd7e5d..10537dba 100644 --- a/cmds/cmds.ts +++ b/cmds/cmds.ts @@ -6,6 +6,8 @@ import * as child_process from "child_process"; let writeFileAsync: any = Promise.promisify(fs.writeFile) let execAsync: (cmd: string, options?: { cwd?: string }) => Promise = Promise.promisify(child_process.exec) +let readDirAsync = Promise.promisify(fs.readdir) + export function deployCoreAsync(res: ts.pxt.CompileResult) { return getBitDrivesAsync() @@ -37,6 +39,10 @@ function getBitDrivesAsync(): Promise { }) return res }) + } + else if (process.platform == "darwin") { + return readDirAsync("/Volumes") + .then(lst => lst.filter(s => /MICROBIT/.test(s)).map(s => "/Volumes/" + s + "/")) } else { return Promise.resolve([]) }