Support macOS in automatic deployment
This commit is contained in:
parent
2629192bdb
commit
8edd8ac73a
@ -6,6 +6,8 @@ import * as child_process from "child_process";
|
|||||||
|
|
||||||
let writeFileAsync: any = Promise.promisify(fs.writeFile)
|
let writeFileAsync: any = Promise.promisify(fs.writeFile)
|
||||||
let execAsync: (cmd: string, options?: { cwd?: string }) => Promise<Buffer> = Promise.promisify(child_process.exec)
|
let execAsync: (cmd: string, options?: { cwd?: string }) => Promise<Buffer> = Promise.promisify(child_process.exec)
|
||||||
|
let readDirAsync = Promise.promisify(fs.readdir)
|
||||||
|
|
||||||
|
|
||||||
export function deployCoreAsync(res: ts.pxt.CompileResult) {
|
export function deployCoreAsync(res: ts.pxt.CompileResult) {
|
||||||
return getBitDrivesAsync()
|
return getBitDrivesAsync()
|
||||||
@ -37,6 +39,10 @@ function getBitDrivesAsync(): Promise<string[]> {
|
|||||||
})
|
})
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
else if (process.platform == "darwin") {
|
||||||
|
return readDirAsync("/Volumes")
|
||||||
|
.then(lst => lst.filter(s => /MICROBIT/.test(s)).map(s => "/Volumes/" + s + "/"))
|
||||||
} else {
|
} else {
|
||||||
return Promise.resolve([])
|
return Promise.resolve([])
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user