Skip to content

Commit ad32d32

Browse files
committed
wip
1 parent 4d2ddb8 commit ad32d32

File tree

2 files changed

+0
-59
lines changed

2 files changed

+0
-59
lines changed

src/utils/install.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
LOCAL_CLI_INSTALLATION_DIRNAME,
1313
} from "../constants.ts";
1414

15-
import { execLocalStack } from "./cli.ts";
1615
import { exec } from "./exec.ts";
1716
import { minDelay } from "./promises.ts";
1817
import {
@@ -23,18 +22,6 @@ import {
2322
import { spawn } from "./spawn.ts";
2423
import type { Telemetry } from "./telemetry.ts";
2524

26-
// export async function checkLocalstackInstalled(
27-
// cliPath: string|undefined,
28-
// outputChannel: LogOutputChannel,
29-
// ): Promise<boolean> {
30-
// try {
31-
// await execLocalStack(cliPath, ["--version"], { outputChannel });
32-
// return true;
33-
// } catch (error) {
34-
// return false;
35-
// }
36-
// }
37-
3825
export interface RunInstallProcessOptions {
3926
progress: Progress<{ message: string }>;
4027
cancellationToken: CancellationToken;

src/utils/promises.ts

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pMinDelay from "p-min-delay";
2-
import type { Disposable } from "vscode";
32

43
/**
54
* Setting up a minimum wait time allows users
@@ -33,48 +32,3 @@ export function minDelay<T>(
3332
MIN_TIME_BETWEEN_STEPS_MS,
3433
);
3534
}
36-
37-
/**
38-
* Extracts the resolved type from a Promise.
39-
*/
40-
export type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
41-
42-
export function setIntervalPromise(
43-
callback: () => Promise<void>,
44-
intervalMs: number,
45-
): Disposable {
46-
let timeout: NodeJS.Timeout | undefined;
47-
let disposed = false;
48-
49-
const runLater = () => {
50-
timeout = setTimeout(() => void run(), intervalMs);
51-
};
52-
53-
const run = async () => {
54-
if (disposed) {
55-
return;
56-
}
57-
58-
try {
59-
await callback();
60-
} catch {
61-
// Ignore errors
62-
} finally {
63-
if (!disposed) {
64-
runLater();
65-
}
66-
}
67-
};
68-
69-
runLater();
70-
71-
return {
72-
dispose: () => {
73-
disposed = true;
74-
if (timeout) {
75-
clearTimeout(timeout);
76-
timeout = undefined;
77-
}
78-
},
79-
};
80-
}

0 commit comments

Comments
 (0)