1- import { commands } from "vscode" ;
1+ import { commands , window } from "vscode" ;
22
33import { createPlugin } from "../plugins.ts" ;
44import {
99
1010export default createPlugin (
1111 "manage" ,
12- ( { context, outputChannel, telemetry } ) => {
12+ ( { context, outputChannel, telemetry, localStackStatusTracker } ) => {
1313 context . subscriptions . push (
1414 commands . registerCommand ( "localstack.viewLogs" , ( ) => {
1515 outputChannel . show ( true ) ;
@@ -18,12 +18,22 @@ export default createPlugin(
1818
1919 context . subscriptions . push (
2020 commands . registerCommand ( "localstack.start" , ( ) => {
21+ if ( localStackStatusTracker . status ( ) !== "stopped" ) {
22+ window . showInformationMessage ( "LocalStack is already running." ) ;
23+ return ;
24+ }
25+ localStackStatusTracker . forceStarting ( ) ;
2126 void startLocalStack ( outputChannel , telemetry ) ;
2227 } ) ,
2328 ) ;
2429
2530 context . subscriptions . push (
2631 commands . registerCommand ( "localstack.stop" , ( ) => {
32+ if ( localStackStatusTracker . status ( ) !== "running" ) {
33+ window . showInformationMessage ( "LocalStack is not running." ) ;
34+ return ;
35+ }
36+ localStackStatusTracker . forceStopping ( ) ;
2737 void stopLocalStack ( outputChannel , telemetry ) ;
2838 } ) ,
2939 ) ;
0 commit comments