Skip to content

Commit

Permalink
feat: add command to init terraform project (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mukundan314 authored Oct 1, 2021
1 parent d084174 commit 0054a26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,6 @@
"command": "terrastate.graph",
"when": "false"
},
{
"command": "terrastate.init",
"when": "false"
},
{
"command": "terrastate.validate",
"when": "false"
Expand Down Expand Up @@ -276,4 +272,4 @@
"dependencies": {
"semver": "^7.3.5"
}
}
}
10 changes: 9 additions & 1 deletion src/terrastateProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,15 @@ export class TerrastateProvider implements vscode.TreeDataProvider<Item> {
}
}

async init(element: Item): Promise<void> {
async init(element?: Item): Promise<void> {
if (element === undefined) {
element = await this.pickTopLevelModule();
}

if (element === undefined) {
return;
}

try {
this.busyDirectories.add(element.directory);
element.setLoading({ topLevel: true });
Expand Down

0 comments on commit 0054a26

Please sign in to comment.