@@ -7,34 +7,24 @@ import {
77 saveAuthToken ,
88 readAuthToken ,
99} from "../utils/authenticate.ts" ;
10- import { findLocalStack } from "../utils/cli.ts" ;
1110import { configureAwsProfiles } from "../utils/configure-aws.ts" ;
1211import { runInstallProcess } from "../utils/install.ts" ;
1312import {
1413 activateLicense ,
1514 checkIsLicenseValid ,
1615 activateLicenseUntilValid ,
1716} from "../utils/license.ts" ;
18- import { minDelay } from "../utils/min-delay .ts" ;
17+ import { minDelay } from "../utils/promises .ts" ;
1918import { updateDockerImage } from "../utils/setup.ts" ;
2019import { get_setup_ended } from "../utils/telemetry.ts" ;
2120
22- async function getValidCliPath ( ) {
23- const cli = await findLocalStack ( ) ;
24- if ( ! cli . cliPath || ! cli . executable || ! cli . found || ! cli . upToDate ) {
25- return ;
26- }
27- return cli . cliPath ;
28- }
29-
3021export default createPlugin (
3122 "setup" ,
3223 ( {
3324 context,
3425 outputChannel,
3526 setupStatusTracker,
3627 localStackStatusTracker,
37- cliStatusTracker,
3828 telemetry,
3929 } ) => {
4030 context . subscriptions . push (
@@ -53,7 +43,7 @@ export default createPlugin(
5343 } ,
5444 } ) ;
5545
56- void window . withProgress (
46+ window . withProgress (
5747 {
5848 location : ProgressLocation . Notification ,
5949 title : "Setup LocalStack" ,
@@ -65,14 +55,13 @@ export default createPlugin(
6555 let authenticationStatus : "COMPLETED" | "SKIPPED" = "COMPLETED" ;
6656 {
6757 const installationStartedAt = new Date ( ) . toISOString ( ) ;
68- const { cancelled, skipped } = await runInstallProcess ( {
69- cliPath : cliStatusTracker . cliPath ( ) ,
58+ const { cancelled, skipped } = await runInstallProcess (
7059 progress ,
7160 cancellationToken ,
7261 outputChannel ,
7362 telemetry ,
74- origin : origin_trigger ,
75- } ) ;
63+ origin_trigger ,
64+ ) ;
7665 cliStatus = skipped === true ? "SKIPPED" : "COMPLETED" ;
7766 if ( cancelled || cancellationToken . isCancellationRequested ) {
7867 telemetry . track ( {
@@ -232,52 +221,14 @@ export default createPlugin(
232221 /////////////////////////////////////////////////////////////////////
233222 progress . report ( { message : "Checking LocalStack license..." } ) ;
234223
235- // If the CLI status tracker doesn't have a valid CLI path yet,
236- // we must find it manually. This may occur when installing the
237- // CLI as part of the setup process: the CLI status tracker will
238- // detect the CLI path the next tick.
239- const cliPath =
240- cliStatusTracker . cliPath ( ) ?? ( await getValidCliPath ( ) ) ;
241- if ( ! cliPath ) {
242- telemetry . track (
243- get_setup_ended (
244- cliStatus ,
245- authenticationStatus ,
246- "CANCELLED" ,
247- "CANCELLED" ,
248- "FAILED" ,
249- origin_trigger ,
250- await readAuthToken ( ) ,
251- ) ,
252- ) ;
253- void window
254- . showErrorMessage (
255- "Could not access the LocalStack CLI." ,
256- {
257- title : "Restart Setup" ,
258- command : "localstack.setup" ,
259- } ,
260- {
261- title : "View Logs" ,
262- command : "localstack.viewLogs" ,
263- } ,
264- )
265- . then ( ( selection ) => {
266- if ( selection ) {
267- void commands . executeCommand ( selection . command ) ;
268- }
269- } ) ;
270- return ;
271- }
272-
273224 // If an auth token has just been obtained or LocalStack has never been started,
274225 // then there will be no license info to be reported by `localstack license info`.
275226 // Also, an expired license could be cached.
276227 // Activating the license pre-emptively to know its state during the setup process.
277228 const licenseCheckStartedAt = new Date ( ) . toISOString ( ) ;
278229 const licenseIsValid = await minDelay (
279- activateLicense ( cliPath , outputChannel ) . then ( ( ) =>
280- checkIsLicenseValid ( cliPath , outputChannel ) ,
230+ activateLicense ( outputChannel ) . then ( ( ) =>
231+ checkIsLicenseValid ( outputChannel ) ,
281232 ) ,
282233 ) ;
283234 if ( ! licenseIsValid ) {
@@ -289,7 +240,6 @@ export default createPlugin(
289240 await commands . executeCommand ( "localstack.openLicensePage" ) ;
290241
291242 await activateLicenseUntilValid (
292- cliPath ,
293243 outputChannel ,
294244 cancellationToken ,
295245 ) ;
0 commit comments