fix: check CI on local build and start (#182)

This commit is contained in:
Joaquín Sánchez 2022-11-27 16:04:04 +01:00 committed by GitHub
parent 3cbdf9eab5
commit 509ff9e016
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -2,6 +2,7 @@
import _fs from 'unstorage/drivers/fs'
// @ts-expect-error unstorage needs to provide backwards-compatible subpath types
import _kv from 'unstorage/drivers/cloudflare-kv-http'
import { isCI } from 'std-env'
import { $fetch } from 'ohmyfetch'
import type { Storage } from 'unstorage'
@ -13,14 +14,14 @@ import { APP_NAME } from '~/constants'
const runtimeConfig = useRuntimeConfig()
export const HOST_DOMAIN = runtimeConfig.deployUrl
|| (process.dev ? 'http://localhost:5314' : 'https://elk.zone')
|| (process.dev || !isCI ? 'http://localhost:5314' : 'https://elk.zone')
const fs = _fs as typeof import('unstorage/dist/drivers/fs')['default']
const kv = _kv as typeof import('unstorage/dist/drivers/cloudflare-kv-http')['default']
const storage = useStorage() as Storage
if (process.dev) {
if (process.dev || !isCI) {
storage.mount('servers', fs({ base: 'node_modules/.cache/servers' }))
}
else {