@@ -208,7 +208,7 @@ func (a *App) tryInstallingViaInstaller(d Dependency) bool {
208208 return false
209209 }
210210 if installerInfo .defaultExecutableDir .IsPresent {
211- if err := ensureDirInPath (installerInfo .defaultExecutableDir .Value ); err != nil {
211+ if err := ensureDirInRuntimePath (installerInfo .defaultExecutableDir .Value ); err != nil {
212212 slog .Warn ("error while adding a newly installed (via installer) dependency to PATH" , "error" , err , "dependency" , d )
213213 }
214214 }
@@ -261,16 +261,17 @@ func (a *App) tryInstallingFromArchive(d Dependency) bool {
261261 return false
262262 }
263263 unzipPath := a .findUnzipPath (archiveInfo .url )
264+ a .printer .Println ("Extracting..." )
264265 if err := unzipFile (archive , unzipPath ); err != nil {
265266 slog .Warn ("unable to unzip the archive" , "dependency" , d , "error" , err , "archive path" , archive , "unzip path" , unzipPath )
266267 return false
267268 }
268269 // Updating PATH
269270 pathElements := make ([]string , 0 , len (archiveInfo .executableSubpath )+ 1 )
270271 pathElements = append (pathElements , unzipPath )
271- copy (pathElements [ 1 :] , archiveInfo .executableSubpath )
272+ pathElements = append (pathElements , archiveInfo .executableSubpath ... )
272273 pathToDirWithDependency := filepath .Join (pathElements ... )
273- if err := ensureDirInPath (pathToDirWithDependency ); err != nil {
274+ if err := ensureDirInUserPath (pathToDirWithDependency ); err != nil {
274275 slog .Warn ("unable to add dependency to PATH" , "dependency" , d , "error" , err )
275276 a .printer .PrintErrf ("unable to add %s (%s) to PATH; consider adding it manually" + lib .NewLine (), d , pathToDirWithDependency )
276277 }
0 commit comments