Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for project specific environment variables #263

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

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
@@ -38,6 +42,16 @@ export namespace Utility {
});
}

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.

@@ -412,7 +412,9 @@ export class TomcatController {
const serverPort: string = await Utility.getPort(serverConfig, Constants.PortKind.Server);
const httpPort: string = await Utility.getPort(serverConfig, Constants.PortKind.Http);
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