@@ -23,6 +23,7 @@ import (
2323
2424 "github.com/charmbracelet/huh"
2525 "github.com/charmbracelet/huh/spinner"
26+ "github.com/charmbracelet/lipgloss"
2627 "github.com/livekit/livekit-cli/pkg/bootstrap"
2728 "github.com/livekit/livekit-cli/pkg/config"
2829 "github.com/urfave/cli/v3"
@@ -259,10 +260,16 @@ func setupTemplate(ctx context.Context, cmd *cli.Command) error {
259260
260261 if install {
261262 fmt .Println ("Installing template..." )
262- return doInstall (ctx , bootstrap .TaskInstall , appName , verbose )
263+ if err := doInstall (ctx , bootstrap .TaskInstall , appName , verbose ); err != nil {
264+ return err
265+ }
263266 } else {
264- return doPostCreate (ctx , cmd , appName , verbose )
267+ if err := doPostCreate (ctx , cmd , appName , verbose ); err != nil {
268+ return err
269+ }
265270 }
271+
272+ return cleanupTemplate (ctx , cmd , appName )
266273}
267274
268275func cloneTemplate (_ context.Context , cmd * cli.Command , url , appName string ) error {
@@ -296,6 +303,10 @@ func cloneTemplate(_ context.Context, cmd *cli.Command, url, appName string) err
296303 return relocate ()
297304}
298305
306+ func cleanupTemplate (ctx context.Context , cmd * cli.Command , appName string ) error {
307+ return bootstrap .CleanupTemplate (appName )
308+ }
309+
299310func instantiateEnv (ctx context.Context , cmd * cli.Command , rootPath string , addlEnv * map [string ]string ) error {
300311 env := map [string ]string {
301312 "LIVEKIT_API_KEY" : project .APIKey ,
@@ -348,8 +359,9 @@ func doPostCreate(ctx context.Context, _ *cli.Command, rootPath string, verbose
348359 var cmdErr error
349360 if err := spinner .New ().
350361 Title ("Cleaning up..." ).
362+ TitleStyle (lipgloss .NewStyle ()).
363+ Style (lipgloss .NewStyle ()).
351364 Action (func () { cmdErr = task () }).
352- Style (theme .Focused .Title ).
353365 Accessible (true ).
354366 Run (); err != nil {
355367 return err
0 commit comments