Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed May 18, 2024
1 parent 562544d commit 5703dfc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
14 changes: 2 additions & 12 deletions storage/framework/cloud/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import process from 'node:process'
import { log } from '@stacksjs/cli'
import { config } from '@stacksjs/config'
import { config, determineAppEnv } from '@stacksjs/config'
import { env } from '@stacksjs/env'
import { slug as slugify } from '@stacksjs/strings'
import { ExitCode } from '@stacksjs/types'
Expand All @@ -11,17 +11,7 @@ import { getOrCreateTimestamp } from '../core/cloud/src/helpers'
import type { CloudOptions } from '../core/cloud/src/types'

const app = new App()
const appEnv =
(config.app.env as string) === 'local'
? 'dev'
: (config.app.env as string) === 'development'
? 'dev'
: (config.app.env as string) === 'staging'
? 'stage'
: (config.app.env as string) === 'production'
? 'prod'
: config.app.env

const appEnv = determineAppEnv()
const appKey = config.app.key
const domain = config.app.url
const appName = config.app.name?.toLowerCase() ?? 'stacks'
Expand Down
9 changes: 9 additions & 0 deletions storage/framework/core/config/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,12 @@ export const {
export { defaults, overrides }

export * from './helpers'

export const determineAppEnv = (): string => {
if (app.env === 'local') return 'dev'
if (app.env === 'development') return 'dev'
if (app.env === 'staging') return 'stage'
if (app.env === 'production') return 'prod'

return app.env
}

0 comments on commit 5703dfc

Please sign in to comment.