-
Notifications
You must be signed in to change notification settings - Fork 35
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
base: develop
Are you sure you want to change the base?
Conversation
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'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path.join(workdir, '.env');
Please also resolve the conflicting files. |
- Removed deprecated vscode.workspace.rootPath-
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
@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); |
There was a problem hiding this comment.
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?
Addresses: #248
Create .env file in your project folder.
See https://www.npmjs.com/package/dotenv for details.