@@ -611,7 +611,8 @@ func applyPromptRenderings(ctx context.Context, cli *cli, screenTagMap map[strin
611611 cli .renderer .Errorf ("%s batch %d-%d failed: %v" , debugPrefix , i + 1 , end , err )
612612 cli .renderer .Infof ("%s rollback starting for screens 1-%d..." , debugPrefix , i )
613613 } else {
614- cli .renderer .Errorf ("patch failed; rolling back..." )
614+ // Removed the redundant log: cli.renderer.Errorf("patch failed; rolling back...").
615+ cli .renderer .Warnf ("Patch failed. Attempting rollback..." )
615616 }
616617
617618 // Rollback all fully-applied previous batches.
@@ -625,7 +626,7 @@ func applyPromptRenderings(ctx context.Context, cli *cli, screenTagMap map[strin
625626 if cli .debug {
626627 cli .renderer .Warnf ("%s rollback failed for screens %d-%d: %v" , debugPrefix , r + 1 , rEnd , rbErr )
627628 } else {
628- cli .renderer .Warnf ("rollback failed" )
629+ cli .renderer .Warnf ("Partial rollback failed for screens %d-%d." , r + 1 , rEnd )
629630 }
630631 } else {
631632 if cli .debug {
@@ -634,7 +635,7 @@ func applyPromptRenderings(ctx context.Context, cli *cli, screenTagMap map[strin
634635 }
635636 }
636637
637- cli .renderer .Infof ("rolled back for all screens " )
638+ cli .renderer .Infof ("Rollback complete for all applied batches. " )
638639
639640 if cli .debug {
640641 return fmt .Errorf ("%s update failed at batch %d-%d: %w" , debugPrefix , i + 1 , end , err )
@@ -650,12 +651,12 @@ func applyPromptRenderings(ctx context.Context, cli *cli, screenTagMap map[strin
650651func watchAndPatch (ctx context.Context , cli * cli , assetsURL , distPath string , screensToWatch []string , originalHeadTags map [string ][]interface {}) error {
651652 watcher , err := fsnotify .NewWatcher ()
652653 if err != nil {
653- return fmt .Errorf ("failed to create watcher: %w" , err )
654+ return fmt .Errorf ("failed to create file system watcher: %w" , err )
654655 }
655656 defer watcher .Close ()
656657
657658 if err := watcher .Add (distPath ); err != nil {
658- return fmt .Errorf ("failed to watch %s: %w" , distPath , err )
659+ return fmt .Errorf ("failed to watch distribution path %s: %w" , distPath , err )
659660 }
660661
661662 fmt .Println ("👀 Watching: " + ansi .Yellow (strings .Join (screensToWatch , ", " )))
@@ -677,25 +678,26 @@ func watchAndPatch(ctx context.Context, cli *cli, assetsURL, distPath string, sc
677678 time .Sleep (1 * time .Second )
678679 fmt .Fprintln (os .Stderr , ansi .Yellow ("\n Shutting down ACUL connected mode..." ))
679680 if len (originalHeadTags ) > 0 {
680- restore := prompt .Confirm (
681- "Would you like to restore your original rendering settings?" ,
682- )
681+ restore := prompt .Confirm ("Would you like to restore your original rendering settings?" )
683682
684683 if restore {
685- fmt .Fprintln (os .Stdout , ansi .Cyan ("Restoring original rendering settings..." ))
684+ fmt .Fprintln (os .Stderr , ansi .Cyan ("Restoring original rendering settings..." ))
686685
687686 if err := applyPromptRenderings (ctx , cli , originalHeadTags , "Restoring" ); err != nil {
688- fmt .Fprintln (os .Stdout , ansi .Yellow (fmt .Sprintf ("Failed to restore previous settings : %v" , err )))
687+ fmt .Fprintln (os .Stderr , ansi .Yellow (fmt .Sprintf ("Restoration failed : %v" , err )))
689688 } else {
690- fmt .Fprintln (os .Stdout , ansi .Green (fmt .Sprintf ("Successfully restored rendering settings for %d screen(s)." , len (originalHeadTags ))))
689+ fmt .Fprintln (os .Stderr , ansi .Green (fmt .Sprintf ("Successfully restored rendering settings for %d screen(s)." , len (originalHeadTags ))))
691690 }
692691 } else {
693- fmt .Fprintln (os .Stdout , ansi .Yellow ("Restoration skipped. The patched assets will continue to remain active in your Auth0 tenant." ))
692+ fmt .Fprintln (os .Stderr , ansi .Yellow ("Restoration skipped. The patched assets will continue to remain active in your Auth0 tenant." ))
694693 }
695694 }
696695
697696 fmt .Println ()
698- fmt .Fprintln (os .Stdout , ansi .Green ("👋 ACUL connected mode stopped." ))
697+ fmt .Fprintln (os .Stderr , ansi .Green ("👋 ACUL connected mode stopped." ))
698+
699+ fmt .Fprintf (os .Stderr , "%s Use %s to see all available commands\n \n " ,
700+ ansi .Yellow ("💡 Tip:" ), ansi .Cyan ("auth0 acul --help" ))
699701 }
700702
701703 for {
@@ -725,7 +727,7 @@ func watchAndPatch(ctx context.Context, cli *cli, assetsURL, distPath string, sc
725727 headTags , err := buildHeadTagsFromDirs (distPath , assetsURL , screen )
726728 if err != nil {
727729 if cli .debug {
728- cli .renderer .Warnf (ansi .Yellow (fmt .Sprintf ("Skipping '%s': %v" , screen , err )))
730+ cli .renderer .Warnf (ansi .Yellow (fmt .Sprintf ("Skipping '%s': failed to build head tags: %v" , screen , err )))
729731 }
730732 continue
731733 }
@@ -742,7 +744,7 @@ func watchAndPatch(ctx context.Context, cli *cli, assetsURL, distPath string, sc
742744
743745 if len (changedScreens ) == 0 {
744746 if cli .debug {
745- fmt .Println (ansi .Yellow ("No effective asset changes detected and skipping patch." ))
747+ fmt .Println (ansi .Yellow ("No effective asset changes detected, skipping patch." ))
746748 }
747749 continue
748750 }
@@ -755,7 +757,7 @@ func watchAndPatch(ctx context.Context, cli *cli, assetsURL, distPath string, sc
755757 }
756758
757759 if err = applyPromptRenderings (ctx , cli , newHeadTags , "Patching" ); err != nil {
758- cli .renderer .Errorf ("Patch failed: %v" , err )
760+ cli .renderer .Errorf ("Patching assets failed: %v" , err )
759761 } else {
760762 fmt .Println (ansi .Green ("✅ Assets patched successfully!" ))
761763 for screen , headTags := range newHeadTags {
@@ -764,16 +766,14 @@ func watchAndPatch(ctx context.Context, cli *cli, assetsURL, distPath string, sc
764766 }
765767
766768 case err := <- watcher .Errors :
767- cli .renderer .Warnf ("Watcher error: %v" , err )
769+ cli .renderer .Warnf ("File watcher internal error: %v" , err )
768770
769771 case <- sigChan :
770772 cleanup ()
771- printAvailableCommands ()
772773 return nil
773774
774775 case <- ctx .Done ():
775776 cleanup ()
776- printAvailableCommands ()
777777 return ctx .Err ()
778778 }
779779 }
0 commit comments