Skip to content

Commit

Permalink
[vscode][5/n] Setup Env Variables: Read the text from the env templat…
Browse files Browse the repository at this point in the history
…e and append to existing file

TSIA, and making the function async now that we call an await statement


## Test Plan
  • Loading branch information
Rossdan Craig [email protected] committed Feb 22, 2024
1 parent 54a32aa commit 63e96ea
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions vscode-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(
vscode.commands.registerCommand(
COMMANDS.SETUP_ENVIRONMENT_VARIABLES,
() => {
setupEnvironmentVariables(context);
async () => {
await setupEnvironmentVariables(context);
}
)
);
Expand Down Expand Up @@ -764,13 +764,9 @@ async function setupEnvironmentVariables(context: vscode.ExtensionContext) {
);

if (fs.existsSync(envPath)) {
var helperText: string = "\ntest, will change next PR";
// fs.readFile(envTemplatePath.fsPath, function read(err, data) {
// if (err) {
// throw err;
// }
// helperText = "\n" + data.toString();
// });
const helperText = (
await vscode.workspace.fs.readFile(envTemplatePath)
).toString();

// TODO: Check if we already appended the template text to existing .env
// file before. If we did, don't do it again
Expand Down

0 comments on commit 63e96ea

Please sign in to comment.