Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to change the installation directory when installing from source #1304

Closed
AnonymousAccount6688 opened this issue Jun 26, 2023 · 1 comment · Fixed by #1409
Closed

how to change the installation directory when installing from source #1304

AnonymousAccount6688 opened this issue Jun 26, 2023 · 1 comment · Fixed by #1409
Labels
good-first-issue A good issue or enhancement for a first time contributor help-wanted The core maintainers aren't planning to build this, but we would welcome a community contribution! installation Specific to installation and uninstallation platform:linux Specific to a Linux-based platform

Comments

@AnonymousAccount6688
Copy link

I don't have the root permission, so I tried to install from source. I used the command sh install-from-source.sh.

However, it always install to the directory /usr/local/bin, which I cannot since I don't have the permission to write file into the directory.

Is there a way, like --prefix= to change the installation directory to my home directory?

@ldennington
Copy link
Contributor

There is currently no way to change the install location since usr/local/bin is the standard place for non-system binaries to be installed on Linux. However, we would be open to a community contribution for this feature. Here is the script if you are interested in making that change!

@mjcheetham mjcheetham added platform:linux Specific to a Linux-based platform installation Specific to installation and uninstallation help-wanted The core maintainers aren't planning to build this, but we would welcome a community contribution! good-first-issue A good issue or enhancement for a first time contributor labels Jun 27, 2023
ldennington added a commit that referenced this issue Oct 19, 2023
This PR fix #1304.

I found that the add func add_to_PATH [1] doesn't persist the path
to the $PATH env variable.

To persist in the current shell is necessary to use a dot or `source`
see doc [2].

_When a script is run using source it runs within the existing shell,
any variables created or modified by the script will remain available
after the script completes. In contrast if the script is run just as
filename, then a separate subshell (with a completely separate set of
variables) would be spawned to run the script._

To persist the PATH among the reboot/new shell, it is necessary to
update the _.profile_ with `echo 'PATH="$PATH:$installPath'
>>~/.profile`.

I don't know if this is the correct behavior, Prior to this commit, it
was working because the `/usr/local/bin` is already in the PATH.

[1]: https://github.com/git-ecosystem/git-credential-manager/blob/afcb6b87302b34d1809a0a057f24c7ba7a3ff5db/src/linux/Packaging.Linux/install-from-source.sh#L94
[2]: https://ss64.com/bash/source.htmlvvvvvvv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue A good issue or enhancement for a first time contributor help-wanted The core maintainers aren't planning to build this, but we would welcome a community contribution! installation Specific to installation and uninstallation platform:linux Specific to a Linux-based platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants