mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
28 lines
633 B
JavaScript
28 lines
633 B
JavaScript
import axios from 'axios'
|
|
import 'dotenv/config'
|
|
|
|
import {
|
|
storkVersion,
|
|
storkExecutableName,
|
|
storkExecutablePath,
|
|
storkTomlPath,
|
|
} from '~/helpers/stork/config.js'
|
|
|
|
export async function downloadStorkToml () {
|
|
const apiUrl = new URL( process.env.PUBLIC_API_DOMAIN )
|
|
|
|
apiUrl.pathname = storkTomlPath.replace('/static', '')
|
|
|
|
console.log('apiUrl', apiUrl)
|
|
|
|
// await axios( apiUrl.toString() )
|
|
|
|
|
|
axios({
|
|
method: "get",
|
|
url: apiUrl.toString(),
|
|
responseType: "stream"
|
|
}).then(function (response) {
|
|
response.data.pipe(fs.createWriteStream( storkTomlPath ))
|
|
})
|
|
}
|