Skip to content

Commit f111456

Browse files
committed
Fix formatting
1 parent 878347d commit f111456

File tree

2 files changed

+39
-40
lines changed

2 files changed

+39
-40
lines changed

src/plugins/setup.ts

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -236,25 +236,24 @@ export default createPlugin(
236236
});
237237
await minDelay(Promise.resolve());
238238

239-
if (!imagePulled) {
240-
progress.report({
241-
message:
242-
"Downloading LocalStack docker image...",
243-
});
244-
await minDelay(pullImageProcess);
245-
}
239+
if (!imagePulled) {
240+
progress.report({
241+
message: "Downloading LocalStack docker image...",
242+
});
243+
await minDelay(pullImageProcess);
244+
}
246245

247-
if (cancellationToken.isCancellationRequested) {
248-
telemetry.track({
249-
name: "setup_ended",
250-
payload: {
251-
namespace: "onboarding",
252-
steps: [1, 2, 3],
253-
status: "CANCELLED",
254-
},
255-
});
256-
return;
257-
}
246+
if (cancellationToken.isCancellationRequested) {
247+
telemetry.track({
248+
name: "setup_ended",
249+
payload: {
250+
namespace: "onboarding",
251+
steps: [1, 2, 3],
252+
status: "CANCELLED",
253+
},
254+
});
255+
return;
256+
}
258257

259258
/////////////////////////////////////////////////////////////////////
260259
if (localStackStatusTracker.status() === "running") {

src/utils/setup.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,28 @@ const InspectSchema = z.array(
4848
async function getDockerImageSemverVersion(
4949
outputChannel: LogOutputChannel,
5050
): Promise<string | undefined> {
51-
try {
52-
const { stdout } = await exec(`docker inspect ${LOCALSTACK_DOCKER_IMAGE}`);
53-
const data: unknown = JSON.parse(stdout);
54-
const parsed = InspectSchema.safeParse(data);
55-
if (!parsed.success) {
56-
throw new Error(
57-
`Could not parse "docker inspect" output: ${JSON.stringify(z.treeifyError(parsed.error))}`,
58-
);
59-
}
60-
const env = parsed.data[0]?.Config.Env ?? [];
61-
const imageVersion = env
62-
.find((line) => line.startsWith("LOCALSTACK_BUILD_VERSION="))
63-
?.slice("LOCALSTACK_BUILD_VERSION=".length);
64-
if (!imageVersion) {
65-
return;
66-
}
67-
return imageVersion;
68-
} catch (error) {
69-
outputChannel.error("Could not inspect LocalStack docker image");
70-
outputChannel.error(error instanceof Error ? error : String(error));
71-
return undefined;
72-
}
51+
try {
52+
const { stdout } = await exec(`docker inspect ${LOCALSTACK_DOCKER_IMAGE}`);
53+
const data: unknown = JSON.parse(stdout);
54+
const parsed = InspectSchema.safeParse(data);
55+
if (!parsed.success) {
56+
throw new Error(
57+
`Could not parse "docker inspect" output: ${JSON.stringify(z.treeifyError(parsed.error))}`,
58+
);
59+
}
60+
const env = parsed.data[0]?.Config.Env ?? [];
61+
const imageVersion = env
62+
.find((line) => line.startsWith("LOCALSTACK_BUILD_VERSION="))
63+
?.slice("LOCALSTACK_BUILD_VERSION=".length);
64+
if (!imageVersion) {
65+
return;
66+
}
67+
return imageVersion;
68+
} catch (error) {
69+
outputChannel.error("Could not inspect LocalStack docker image");
70+
outputChannel.error(error instanceof Error ? error : String(error));
71+
return undefined;
72+
}
7373
}
7474

7575
async function pullDockerImage(

0 commit comments

Comments
 (0)