Skip to content

Commit 7674488

Browse files
committed
improv: show msg on successful init and validate
1 parent b624fd3 commit 7674488

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,23 @@ To view the list of commands, left-click on the **directory**/**resource** in th
3737

3838
### Directory Level
3939

40-
| Command | Description |
41-
| ------------------------ | ---------------------------------------------------- |
42-
| Apply All | Runs `terraform apply` on directory level |
43-
| Destory All | Runs `terraform destroy` on directory level |
44-
| Initialize | Runs `terraform init` on the directory |
45-
| Refresh | Runs `terraform refresh` on the directory |
46-
| Validate | Runs `terraform validate` on the directory |
40+
| Command | Description |
41+
| ----------- | ------------------------------------------- |
42+
| Apply All | Runs `terraform apply` on directory level |
43+
| Destory All | Runs `terraform destroy` on directory level |
44+
| Initialize | Runs `terraform init` on the directory |
45+
| Refresh | Runs `terraform refresh` on the directory |
46+
| Validate | Runs `terraform validate` on the directory |
4747

4848
### Resource Level
4949

50-
| Command | Description |
51-
| ------------------------ | ---------------------------------------------------- |
52-
| Apply | Runs `terraform apply` targeted on the resource |
53-
| Destory | Runs `terraform destroy` targeted on the resource |
54-
| Taint | Runs `terraform taint` targeted on the resource |
50+
| Command | Description |
51+
| ------- | ------------------------------------------------- |
52+
| Apply | Runs `terraform apply` targeted on the resource |
53+
| Destory | Runs `terraform destroy` targeted on the resource |
54+
| Taint | Runs `terraform taint` targeted on the resource |
5555
| Untaint | Runs `terraform untaint` targeted on the resource |
5656

57-
5857
## Issues, feature requests, and contributions
5958

6059
### Issues
@@ -91,8 +90,7 @@ Contributions are always welcome!
9190

9291
## Related
9392

94-
- [MIT License](https://github.com/rohinivsenthil/terrastate/blob/master/LICENSE![terrastate](https://user-images.githubusercontent.com/42040329/129020767-85f8e868-48d1-4dd4-92b4-35026c706f40.gif)
95-
)
93+
- [MIT License](<https://github.com/rohinivsenthil/terrastate/blob/master/LICENSE![terrastate](https://user-images.githubusercontent.com/42040329/129020767-85f8e868-48d1-4dd4-92b4-35026c706f40.gif)>)
9694
<!-- - Read the [launch blog]
97-
- Featured #11 Product of the day on
95+
- Featured #11 Product of the day on
9896
- Featured in **Trending this week** on Visual Studio Code Marketplace -->

src/graphProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class GraphProvider implements vscode.TreeDataProvider<vscode.TreeItem> {
5252
item.iconPath = GRAPH;
5353
item.command = {
5454
command: "terrastate.graph",
55-
title: 'Terraform Graph',
55+
title: "Terraform Graph",
5656
tooltip: "Terraform Graph",
5757
arguments: [directory],
5858
};

src/terraform.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ function run(
4949
output += `${error.message}\n`;
5050
}
5151

52-
outputChannel.append(output);
53-
5452
if (error) {
53+
outputChannel.append(output);
54+
5555
if (errorMessage) {
5656
vscode.window
5757
.showErrorMessage(errorMessage, "Show Output")
@@ -114,13 +114,9 @@ export async function setTerraformPath(): Promise<boolean> {
114114

115115
export async function getResources(directory: string): Promise<string[]> {
116116
return [
117-
...(
118-
await run(
119-
terraformPath,
120-
["graph"],
121-
directory,
122-
)
123-
).matchAll(/\[label = "(.*)", shape = "box"]$/gm),
117+
...(await run(terraformPath, ["graph"], directory)).matchAll(
118+
/\[label = "(.*)", shape = "box"]$/gm
119+
),
124120
].map((i) => i[1]);
125121
}
126122

src/terrastateProvider.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ export class TerrastateProvider
254254
try {
255255
this.setBusy(item);
256256
await init(item.directory);
257+
vscode.window.showInformationMessage(
258+
`Successfully initialized ${item.directory}`
259+
);
257260
} catch {
258261
} finally {
259262
this.setIdle(item);
@@ -264,6 +267,9 @@ export class TerrastateProvider
264267
try {
265268
this.setBusy(item);
266269
await validate(item.directory);
270+
vscode.window.showInformationMessage(
271+
`Successfully validated ${item.directory}`
272+
);
267273
} catch {
268274
} finally {
269275
this.setIdle(item);

0 commit comments

Comments
 (0)