win support

This commit is contained in:
Opportunity
2019-09-30 22:20:31 +08:00
Unverified
parent a363ea93aa
commit 2ffbdbc518
338 changed files with 113 additions and 73316 deletions
+24
View File
@@ -0,0 +1,24 @@
const exec = require('@actions/exec').exec
const io = require('@actions/io')
const os = require('os')
const path = require('path')
const folder = path.join(os.tmpdir(), `xmake${Date.now()}`)
const opt = { cwd: folder }
module.exports.folder = folder
module.exports.create = async function (ref) {
await io.rmRF(folder)
await io.mkdirP(folder)
await exec('git', ['init'], opt)
await exec('git', ['remote', 'add', 'origin', 'https://github.com/xmake-io/xmake.git'], opt)
await exec('git', ['fetch'], opt)
await exec('git', ['checkout', ref], opt)
await exec('git', ['submodule', 'update', '--init', '--recursive'], opt)
return folder
}
module.exports.cleanup = async function () {
await io.rmRF(folder)
}