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

Option to skip _patch_bashrc_and_profile #705 #706

Closed
Samueru-sama opened this issue Jun 22, 2024 · 7 comments
Closed

Option to skip _patch_bashrc_and_profile #705 #706

Samueru-sama opened this issue Jun 22, 2024 · 7 comments

Comments

@Samueru-sama
Copy link
Contributor

I would love an option to have the APP-MANAGER script skip the function _patch_bashrc_and_profile where the script writes the following to ~/.bashrc (and other dotfiles):

export PATH=$(echo $PATH | tr ":" "\n" | grep -v "/.local/bin" | tr "\n" ":" | sed s/.$//)
export PATH=$PATH:$HOME/.local/bin

Personally, I don't like anything touching my bash dotfiles and prefer to manage my PATH manually via my own dotfiles.

Any option to disable that would be great. I don't know if you'd prefer an environment variable to control it like [[ -z "${APPMAN_SKIP_PATCH_BASHRC_AND_PROFILE:-} ]] && _patch_bashrc_and_profile or a value in the appman-config config file.


Unrelated to this, I just want to say I love appman. I had ignored AppImages due to the lack of a package management command line tool. Thank you so much for this. This plus AppImaGen and ArchImage are great. I very much appreciate it.

Originally posted by @rvenutolo in #705

@Samueru-sama
Copy link
Contributor Author

Samueru-sama commented Jun 22, 2024

I think the default behavior should be like this:

if ! echo "$PATH" | grep ".local/bin"; then
    function_to_patch
fi

Also do we have to patch the bashrc? I'm a zsh user, on zsh you only have to add $HOME/.local/bin to zprofile, adding it to zshrc would cause $HOME/.local/bin to repeat in PATH the second time you open a terminal window.

@Samueru-sama
Copy link
Contributor Author

Samueru-sama commented Jun 22, 2024

Also worth mentioning that adding $HOME/.local/bin to PATH is job of the distribution as detailed in the XDG Base Dir specification:

User-specific executable files may be stored in $HOME/.local/bin. Distributions should ensure this directory shows up in the UNIX $PATH environment variable, at an appropriate place.

So yeah I think we should just give a warning and ask the user if they want to patch their .profile/.bash_profile.

EDIT: I changed it instead to just patch if we detect that $HOME/.local/bin isn't part of PATH.

@ivan-hc
Copy link
Owner

ivan-hc commented Jun 22, 2024

@Samueru-sama I think you are absolutely right.

I would like to stop patching configuration files, and I would like to delegate everything to the README. It's not "AppMan" who should handle them.

I want to disable the function, or at least I would like an option that can solve the problems.

@Samueru-sama
Copy link
Contributor Author

Samueru-sama commented Jun 22, 2024

@Samueru-sama I think you are absolutely right.

I would like to stop patching configuration files, and I would like to delegate everything to the README. It's not "AppMan" who should handle them.

I want to disable the function, or at least I would like an option that can solve the problems.

In that case we simply issue a warning and ask if the user would like that appman patches their .bash_profile or .profile

edit: adding the question part right now

@ivan-hc
Copy link
Owner

ivan-hc commented Jun 22, 2024

@Samueru-sama we must go talk at #707

@Samueru-sama
Copy link
Contributor Author

@rvenutolo let us know if this works for you.

@rvenutolo
Copy link

This should work for me. Thanks very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants