nuxt-hub / cli

Build full-stack Nuxt application with NuxtHub command line interface (CLI).
Apache License 2.0
46 stars 5 forks source link

`nuxthub deploy --dotenv` ignored #30

Closed angelorc closed 5 days ago

angelorc commented 1 week ago

Description

The nuxthub deploy command includes the --dotenv flag, but this flag is ignored during the linkedProject phase. Upon inspecting the code at this line and the fetchProject() function at this line, it is evident that the --dotenv flag is not taken into account. Instead, the fetchProject function utilizes process.env.

Currently, the --dotenv flag is only considered during the build phase.

This logic becomes cumbersome when managing three different environments:

Ideally, each command should consider the --dotenv flag to facilitate smoother environment management.

Steps to Reproduce

  1. Use the nuxthub deploy command with the --dotenv flag.
  2. Observe that the environment variables specified in the dotenv file are not applied during the linkedProject phase. No project is linked with the NUXT_HUB_PROJECT_KEY environment variable.

Expected Behavior

The --dotenv flag should be considered during all phases of the nuxthub deploy command, including the linkedProject phase.

Actual Behavior

The --dotenv flag is ignored during the linkedProject phase, and only considered during the build phase.

atinux commented 5 days ago

Sorry about this and thank you for reporting it!

You can now use the nuxthub@0.6.5