Feat/Fix to mitigate bugs when you have different usernames on different computers#172
Open
mmorenoregalado wants to merge 1 commit intoCodelyTV:mainfrom
Open
Feat/Fix to mitigate bugs when you have different usernames on different computers#172mmorenoregalado wants to merge 1 commit intoCodelyTV:mainfrom
mmorenoregalado wants to merge 1 commit intoCodelyTV:mainfrom
Conversation
…different user names
Contributor
|
This was done in eternal pending PR #129 In the proposal was done by changing fullpath for a path with The solution is simpler by using string substitution: sed -i -e "s|XXX_DOTFILES_PATH_XXX|$DOTFILES_PATH|g" "${DOTFILES_PATH//$HOME/\$HOME}/shell/zsh/.zshenv" |
Author
|
I understand that, but even when I do it this way, in my .zshenv file I would still write the full path that is: so on my personal computer in the .zshenv file: and at work or other computer: so if what you write in the .zshenv file is the $HOME variable: so there would no longer be a problem with the username it could be any username |
Contributor
|
Yes, I understand the problem. I had the same :) |
sanchezcarlosjr
added a commit
to sanchezcarlosjr/dotly
that referenced
this pull request
Apr 13, 2024
@mmorenoregalado proposes to maintain consistency among different nodes and sessions through CodelyTV@8dc02e4 and CodelyTV#172, which generates a side-effect for users and adds a possible code smell in the future because it introduces an if-else pattern based on a condition that users may not expect. Also it doesn't allow the user to employ other environment variables, so we apply the template engine ideas and differentiate the application of Bash expansion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Use $HOME variable when defining $DOTFILES_PATH in .zshenv file when first installing dotly to mitigate bugs when you have different usernames on different computers
Motivation
At work they gave me a mac mini already configured with a username, there I started creating dotfiles and installing dotly, recently I bought a mac for me and installing dotly, when I imported my dotfiles, the username in .zshenv was different for what it launched an error since on my computer I had a username and another at work. I solved it easily by changing in .zshenv the variable /Users/nameuser/.dotfiles for $ HOME / .dotfiles
At the beginning of the error and newbie using dotly scared me a lot XD
It's easy to fix, but I think maybe it would be good if it was added in the .zshenv file when installing if the path is the default one.