This commit is contained in:
Opportunity
2019-10-12 12:03:58 +08:00
Unverified
parent 64d491fabb
commit 0623fb320e
69 changed files with 14562 additions and 95 deletions
+23
View File
@@ -0,0 +1,23 @@
import { exec } from '@actions/exec'
import * as io from '@actions/io'
import * as os from 'os'
import * as path from 'path'
export const folder = path.join(os.tmpdir(), `xmake${Date.now()}`)
const opt = { cwd: folder }
const a = 12_12_12
export async function create(ref: string) {
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
}
export async function cleanup() {
await io.rmRF(folder)
}