Skip to content

Conversation

@gregd72002
Copy link

Addresses: #248
Create .env file in your project folder.
See https://www.npmjs.com/package/dotenv for details.

@gregd72002 gregd72002 changed the title Support for project environment variables Add support for project specific environment variables Aug 1, 2019
@lavignoble
Copy link

I'm currently using this fork rather than the original one because I need the environment variables to be able to even launch my war package.

Thanks for the work, it works flawlessly !

src/Utility.ts Outdated

export function setEnv(workdir: string): void {
projectEnv = {};
let fpath = workdir+'/.env';
Copy link
Collaborator

@andxu andxu Jun 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path.join(workdir, '.env');

@andxu
Copy link
Collaborator

andxu commented Jun 29, 2020

Please also resolve the conflicting files.

@roberfi
Copy link

roberfi commented Mar 2, 2021

Hi all, I have created a PR to @gregd72002's repository making required changes to merge it here. Waiting for a response.

Prepare brach to merge into adashen's
@gregd72002
Copy link
Author

@roberfi thanks. This is now merged into my repository.

const httpsPort: string = await Utility.getPort(serverConfig, Constants.PortKind.Https);

if (vscode.workspace.workspaceFolders.length > 0) {
Utility.setEnv(vscode.workspace.workspaceFolders[0].uri.path);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hardcode workspaceFolder[0] doesn't seem to be good. What if I have multiple workspace folders, and the app to launch is not under the first one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants