-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: properly load env vars in
create-fuels
template, and add docs …
…for fuels CLI (#2051) * try using dotenv to load env * try removing dotenv * fix: properly load env vars in `create-fuels` template, and add docs for fuels CLI * add fallback values for CI * also include `.env.local`
- Loading branch information
Showing
9 changed files
with
53 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"fuels": patch | ||
--- | ||
|
||
fix: properly load env vars in `create-fuels` template, and add docs for fuels CLI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
// #region fuels-config-file-env | ||
import { createConfig } from 'fuels'; | ||
import dotenv from 'dotenv'; | ||
|
||
dotenv.config({ | ||
path: ['.env.local', '.env'], | ||
}); | ||
|
||
export default createConfig({ | ||
workspace: './sway-programs', | ||
output: './src/sway-api', | ||
/* | ||
This is the same value as the port specified in the `.env.local` file. | ||
Please keep these values in sync. | ||
*/ | ||
fuelCorePort: 4000, | ||
fuelCorePort: +(process.env.NEXT_PUBLIC_FUEL_NODE_PORT as string) || 4000, | ||
}); | ||
// #endregion fuels-config-file-env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import { createConfig } from 'fuels'; | ||
import dotenv from 'dotenv'; | ||
|
||
dotenv.config({ | ||
path: ['.env.local', '.env'], | ||
}); | ||
|
||
export default createConfig({ | ||
workspace: './sway-programs', | ||
output: './src/sway-api', | ||
/* | ||
This is the same value as the port specified in the `.env.local` file. | ||
Please keep these values in sync. | ||
*/ | ||
fuelCorePort: 4000, | ||
fuelCorePort: +(process.env.NEXT_PUBLIC_FUEL_NODE_PORT as string) || 4000, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters