Skip to content

Add support for project specific environment variables#263

Open
gregd72002 wants to merge 9 commits into
adashen:developfrom
gregd72002:develop
Open

Add support for project specific environment variables#263
gregd72002 wants to merge 9 commits into
adashen:developfrom
gregd72002:develop

Conversation

@gregd72002

Copy link
Copy Markdown

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
Copy Markdown

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 !

Comment thread src/Utility.ts Outdated

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

@andxu andxu Jun 29, 2020

Copy link
Copy Markdown
Collaborator

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

andxu commented Jun 29, 2020

Copy link
Copy Markdown
Collaborator

Please also resolve the conflicting files.

@roberfi

roberfi commented Mar 2, 2021

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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