mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
33 lines
795 B
JavaScript
33 lines
795 B
JavaScript
import fs from 'fs-extra'
|
|
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() )
|
|
|
|
|
|
const response = await axios({
|
|
method: "get",
|
|
url: apiUrl.toString(),
|
|
})
|
|
|
|
await fs.writeFile( storkTomlPath, response.data, { encoding: null })
|
|
|
|
// Get toml file stats
|
|
const stats = await fs.stat( storkTomlPath )
|
|
console.log('TOML Stats', storkTomlPath, stats)
|
|
// console.log('TOML Stats', stats)
|
|
}
|