Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
},
{
"command": "localstack.configureAwsProfiles",
"title": "Configure \"localstack\" AWS Profiles",
"title": "Configure AWS Profile \"localstack\"",
"category": "LocalStack"
}
],
Expand Down
5 changes: 3 additions & 2 deletions src/plugins/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
});

window.withProgress(

Check warning on line 64 in src/plugins/setup.ts

View workflow job for this annotation

GitHub Actions / Lint

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
{
location: ProgressLocation.Notification,
title: "Setup LocalStack",
Expand Down Expand Up @@ -220,7 +220,7 @@

/////////////////////////////////////////////////////////////////////
progress.report({
message: "Configuring AWS profiles...",
message: "Configuring AWS profile...",
});
await minDelay(
configureAwsProfiles({
Expand All @@ -232,7 +232,8 @@
void commands.executeCommand("localstack.refreshStatusBar");

progress.report({
message: 'Finished configuring "localstack" AWS profiles.',
message:
'Finished configuring the AWS profile named "localstack".',
});
await minDelay(Promise.resolve());

Expand All @@ -257,25 +258,25 @@

/////////////////////////////////////////////////////////////////////
if (localStackStatusTracker.status() === "running") {
window

Check warning on line 261 in src/plugins/setup.ts

View workflow job for this annotation

GitHub Actions / Lint

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
.showInformationMessage("LocalStack is running.", {
title: "View Logs",
command: "localstack.viewLogs",
})
.then((selection) => {
if (selection) {
commands.executeCommand(selection.command);

Check warning on line 268 in src/plugins/setup.ts

View workflow job for this annotation

GitHub Actions / Lint

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
}
});
} else {
window

Check warning on line 272 in src/plugins/setup.ts

View workflow job for this annotation

GitHub Actions / Lint

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
.showInformationMessage("LocalStack is ready to start.", {
title: "Start LocalStack",
command: "localstack.start",
})
.then((selection) => {
if (selection) {
commands.executeCommand(selection.command);

Check warning on line 279 in src/plugins/setup.ts

View workflow job for this annotation

GitHub Actions / Lint

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
}
});
}
Expand All @@ -295,14 +296,14 @@
);

if (setupStatusTracker.status() === "setup_required") {
window

Check warning on line 299 in src/plugins/setup.ts

View workflow job for this annotation

GitHub Actions / Lint

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
.showInformationMessage("Setup LocalStack to get started.", {
title: "Setup",
command: "localstack.setup",
})
.then((selected) => {
if (selected) {
commands.executeCommand(selected.command, "extension_startup");

Check warning on line 306 in src/plugins/setup.ts

View workflow job for this annotation

GitHub Actions / Lint

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
}
});
}
Expand Down
20 changes: 10 additions & 10 deletions src/utils/configure-aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function overrideSelection(
}
const fileList = filesToModify.join(" and ");
const selection = await window.showWarningMessage(
`The "localstack" AWS profile in ${fileList} exists, but does not match the expected properties. Do you want to override it?`,
`The AWS profile named "localstack" in ${fileList} exists, but does not match the expected properties. Do you want to override it?`,
"Override",
);
return selection;
Expand Down Expand Up @@ -180,7 +180,7 @@ async function configureAwsConfigProfile(
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
window.showErrorMessage(
`Failed to configure the "localstack" AWS profile in [${awsConfigFilenameReadable}]: ${errorMessage}`,
`Failed to configure the AWS profile named "localstack" in [${awsConfigFilenameReadable}]: ${errorMessage}`,
);
}
}
Expand Down Expand Up @@ -238,7 +238,7 @@ async function configureCredentialsProfile(
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
window.showErrorMessage(
`Failed to configure the "localstack" AWS profile in [${awsCredentialsFilenameReadable}]: ${errorMessage}`,
`Failed to configure the AWS profile named "localstack" in [${awsCredentialsFilenameReadable}]: ${errorMessage}`,
);
}
return false;
Expand Down Expand Up @@ -316,7 +316,7 @@ export async function configureAwsProfiles(options: {
// if everything in place, show user that no changes were made and return
if (options?.notifyNoChangesMade) {
window.showInformationMessage(
'The "localstack" AWS profiles were already present, so no changes were made.',
'The AWS profile named "localstack" was already present, so no changes were made.',
);
}
options.telemetry?.track({
Expand All @@ -332,7 +332,7 @@ export async function configureAwsProfiles(options: {
});
return;
} else {
// profiles are there but need adjustment
// profile is there but needs adjustment
// in testing, we always override
if (options?.forceOverride) {
overrideDecision = "Override";
Expand All @@ -346,7 +346,7 @@ export async function configureAwsProfiles(options: {
}
}
} else {
// if any of the profiles don't exist, we need to create it
// we need to create it
overrideDecision = "Override";
}

Expand Down Expand Up @@ -383,7 +383,7 @@ export async function configureAwsProfiles(options: {
),
]);
window.showInformationMessage(
'Successfully added the "localstack" AWS profile to "~/.aws/config" and "~/.aws/credentials".',
'Successfully added the AWS profile named "localstack" to "~/.aws/config" and "~/.aws/credentials".',
);
options.telemetry?.track({
name: "aws_profile_configured",
Expand All @@ -405,7 +405,7 @@ export async function configureAwsProfiles(options: {
overrideDecision,
);
window.showInformationMessage(
'Successfully added the "localstack" AWS profile to "~/.aws/config".',
'Successfully added the AWS profile named "localstack" to "~/.aws/config".',
);
options.telemetry?.track({
name: "aws_profile_configured",
Expand All @@ -427,7 +427,7 @@ export async function configureAwsProfiles(options: {
overrideDecision,
);
window.showInformationMessage(
'Successfully added the "localstack" AWS profile to "~/.aws/credentials".',
'Successfully added the AWS profile named "localstack" to "~/.aws/credentials".',
);
options.telemetry?.track({
name: "aws_profile_configured",
Expand Down Expand Up @@ -464,7 +464,7 @@ export async function checkIsProfileConfigured(): Promise<boolean> {
return false;
}

return true; // Both profiles exist and are properly configured
return true; // profile exists in both files and is properly configured
} catch (error) {
return false;
}
Expand Down
Loading