@@ -97,10 +97,18 @@ func runFlowser(
9797
9898func installFlowser (flowser * flowser.App , installPath string ) (string , error ) {
9999 fmt .Println ("It looks like Flowser is not yet installed on your system." )
100- if ! output .InstallPrompt () {
100+ installChoice := output .InstallPrompt ()
101+ if installChoice == output .CancelInstall {
101102 return "" , fmt .Errorf ("user denied install" )
102103 }
103104
105+ // if user says it already installed it we only ask for path and return it
106+ if installChoice == output .AlreadyInstalled {
107+ installPath = output .InstallPathPrompt (installPath )
108+ _ = settings .SetFlowserPath (installPath )
109+ return installPath , nil
110+ }
111+
104112 // we only allow custom paths on Windows since on MacOS apps needs to be installed inside Application folder
105113 if runtime .GOOS == settings .Windows {
106114 installPath = output .InstallPathPrompt (installPath )
@@ -111,7 +119,13 @@ func installFlowser(flowser *flowser.App, installPath string) (string, error) {
111119 logger .StartProgress (fmt .Sprintf ("%s Installing Flowser, this may take few minutes, please wait " , output .TryEmoji ()))
112120 defer logger .StopProgress ()
113121
114- err := flowser .Install (installPath )
122+ // create all folders if they don't exist, does nothing if they exist
123+ err := os .MkdirAll (installPath , os .ModePerm )
124+ if err != nil {
125+ return "" , err
126+ }
127+
128+ err = flowser .Install (installPath )
115129 if err != nil {
116130 return "" , fmt .Errorf ("could not install Flowser: %w" , err )
117131 }
0 commit comments