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

Override a script provided by dotly with a customized version #238

Open
fragonib opened this issue Jun 4, 2023 · 3 comments
Open

Override a script provided by dotly with a customized version #238

fragonib opened this issue Jun 4, 2023 · 3 comments

Comments

@fragonib
Copy link

fragonib commented Jun 4, 2023

Hi! 👋

Thank you for this effort. I think is great!

I'm trying to write a customized version of a dotly provided script using a dotfiles' script replacement that has the very same script name. I want this new version to override the one provided by dotly framework. However bin/dot command always selects the dotly version first.

It doesn't works like that because bin/dot command is pritoritizing $DOTLY_PATH over $DOTFILES_PATH (last present script file wins)

dotly/bin/dot

Line 48 in ec4be28

script_exist "$DOTFILES_PATH" "$context" "$script" && script_path="$DOTFILES_PATH"

  script_exist "$DOTFILES_PATH" "$context" "$script" && script_path="$DOTFILES_PATH"
  script_exist "$DOTLY_PATH" "$context" "$script" && script_path="$DOTLY_PATH"
  • Is this by design?
  • Is it reasonable for you to swap the folder priority?
  script_exist "$DOTLY_PATH" "$context" "$script" && script_path="$DOTLY_PATH"
  script_exist "$DOTFILES_PATH" "$context" "$script" && script_path="$DOTFILES_PATH"
@fragonib fragonib changed the title Override a script provided by Codely with a customized version Override a script provided by Dotly with a customized version Jun 4, 2023
@gtrabanco
Copy link
Contributor

This is done in my fork, you can see how to do it here: https://github.com/gtrabanco/dotSloth/blob/961d348011957b339d1b9b49a87b89cb5bcb9606/bin/dot#L152

Important if you decide to use my fork! It also changes the way scripts are loaded to avoid load all libraries again it can have different features than Dotly and some scripts can not work.

@fragonib
Copy link
Author

fragonib commented Jun 5, 2023

Thank you @gtrabanco

I'll have a look at it. How hard do you think the migration is?

@gtrabanco
Copy link
Contributor

Should not be so difficult depending on how many stuff do you have, you can copy your .dotfiles and use the migration script I did and see what will happen 🤣

@fragonib fragonib changed the title Override a script provided by Dotly with a customized version Override a script provided by dotly with a customized version Jun 5, 2023
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

2 participants