Skip to content

Commit

Permalink
feat: add support for hub.env in runtimeConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Mar 19, 2024
1 parent a41a8f2 commit d0fefd8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/module/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export default defineNuxtModule<ModuleOptions>({
projectSecretKey: process.env.NUXT_HUB_PROJECT_SECRET_KEY || '',
userToken: process.env.NUXT_HUB_USER_TOKEN || '',
remote: remoteArg || process.env.NUXT_HUB_REMOTE,
version
version,
env: process.env.NUXT_HUB_ENV || 'production'
})
// validate remote option
if (hub.remote && !['true', 'production', 'preview'].includes(String(hub.remote))) {
Expand Down Expand Up @@ -149,6 +150,8 @@ export default defineNuxtModule<ModuleOptions>({
log.error(`No deployment found for \`${env}\`, make sure to deploy the project using \`nuxthub deploy\`.`)
process.exit(1)
}
// Update hub.env in runtimeConfig
hub.env = env
}

// Make sure we have a projectUrl when using the remote option
Expand Down

0 comments on commit d0fefd8

Please sign in to comment.