Skip to content

Commit ba846d8

Browse files
danil vinogradovpsergee
danil vinogradov
authored andcommitted
install: added message with installation path
Since it was not entirely clear where tarantool/tt was installed messages were added indicating the installation path of binary and symbolic link.
1 parent 0c74580 commit ba846d8

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

cli/install/install.go

+25-6
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,15 @@ func copyBuildedTT(binDir, path, version string, installCtx InstallCtx,
418418
return err
419419
}
420420
}
421-
err = util.CopyFilePreserve(filepath.Join(path, "tt"), filepath.Join(binDir, version))
422-
return err
421+
422+
binPathTt := filepath.Join(binDir, version)
423+
err = util.CopyFilePreserve(filepath.Join(path, "tt"), binPathTt)
424+
if err != nil {
425+
return err
426+
}
427+
log.Infof("Tt executable is installed to: %q", binPathTt)
428+
429+
return nil
423430
}
424431

425432
// checkCommit checks the existence of a commit by hash.
@@ -679,11 +686,15 @@ func installTt(binDir string, installCtx InstallCtx, distfiles string) error {
679686
}
680687

681688
// Set symlink.
682-
err = util.CreateSymlink(versionStr, filepath.Join(binDir, "tt"), true)
689+
symlinkPath := filepath.Join(binDir, "tt")
690+
err = util.CreateSymlink(versionStr, symlinkPath, true)
683691
if err != nil {
684692
printLog(logFile.Name())
685693
return err
686694
}
695+
696+
log.Infof("Made default by symlink %q", symlinkPath)
697+
log.Info("Use the following command to add the bin_dir directory to the PATH: . <(tt env)")
687698
log.Infof("Done.")
688699
if installCtx.Noclean {
689700
log.Infof("Artifacts can be found at: %s", path)
@@ -840,8 +851,8 @@ func copyBuildedTarantool(binPath, incPath, binDir, includeDir, version string,
840851
return fmt.Errorf("unable to create %s\n Error: %s", binDir, err)
841852
}
842853

843-
err = util.CopyFileChangePerms(binPath, filepath.Join(binDir, version),
844-
defaultDirPermissions)
854+
execPath := filepath.Join(binDir, version)
855+
err = util.CopyFileChangePerms(binPath, execPath, defaultDirPermissions)
845856
if err != nil {
846857
return err
847858
}
@@ -855,8 +866,14 @@ func copyBuildedTarantool(binPath, incPath, binDir, includeDir, version string,
855866
} else if err != nil {
856867
return fmt.Errorf("unable to create %s\n Error: %s", includeDir, err)
857868
}
869+
858870
err = copy.Copy(incPath, filepath.Join(includeDir, version)+"/")
859-
return err
871+
if err != nil {
872+
return err
873+
}
874+
log.Infof("Tarantool executable is installed to: %q", execPath)
875+
876+
return nil
860877
}
861878

862879
//go:embed Dockerfile.tnt.build
@@ -1203,6 +1220,8 @@ func installTarantool(binDir string, incDir string, installCtx InstallCtx,
12031220
return err
12041221
}
12051222

1223+
log.Infof("Made default by symlink %q", filepath.Join(incDir, "tarantool"))
1224+
log.Info("Use the following command to add the bin_dir directory to the PATH: . <(tt env)")
12061225
log.Infof("Done.")
12071226
if installCtx.Noclean {
12081227
log.Infof("Artifacts can be found at: %s", path)

0 commit comments

Comments
 (0)