Fix not properly trimming static part of path

This commit is contained in:
Sam Carlton 2022-05-10 12:36:43 -05:00
parent 63bae1dc6a
commit 991bdf4261

View file

@ -3,16 +3,16 @@ import axios from 'axios'
import 'dotenv/config'
import {
storkVersion,
storkExecutableName,
storkExecutablePath,
// 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', '')
apiUrl.pathname = storkTomlPath.replace('static/', '')
const response = await axios({
method: "get",
@ -23,6 +23,6 @@ export async function downloadStorkToml () {
// Get toml file stats
const stats = await fs.stat( storkTomlPath )
console.log('TOML is file', storkTomlPath, stats.isFile())
console.log( stats.isFile() ? '✅' : '❌', 'TOML is file', storkTomlPath )
// console.log('TOML Stats', stats)
}