fetch
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
const core = require('@actions/core')
|
||||
const { exec, execSync } = require('child_process')
|
||||
const fetch = require('node-fetch')
|
||||
const fs = require('fs')
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
const version = core.getInput('xmake-version')
|
||||
|
||||
execSync("bash <(curl -fsSL https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.sh)")
|
||||
const data = fetch('https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.sh')
|
||||
await fs.promises.mkdir('/tmp/xmake')
|
||||
await fs.promises.writeFile(`/tmp/xmake/get.sh`, await (await data).buffer())
|
||||
execSync(`bash /tmp/xmake/get.sh`)
|
||||
|
||||
core.addPath("/home/runner/.local/bin")
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user