Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upA more convenient method for controlling the sourcing order of customized scripts. #1505
Comments
|
Couldn't you achieve the same effect by using a naming convention for the custom scripts, with a number prefix, e.g. like this:
The glob that lists the files ( |
|
The problem is that the scripts to be sourced are symlinks pointing to somewhere outside of the custom folder. And I have already some other naming specifications for these scripts. In this case, I don't want to change the naming spec for these scripts. Any hints? |
|
Any I have more scripts in the custom folder which maybe startwith alphabets, in this case, they will be sourced after number-beginning ones. Regards |
|
For your symlinked custom scripts, you could use a different name for the symlink than for the source script in a different location, e.g. like this: ln -s ~/.bash_it/custom/00_aliases.bash ~/foo/bar/aliases.bashThis is the way the Bash-it plugins, aliases and completions are enabled and then loaded. I'm not a fan of introducing more complexity in the way these things are handled. Maybe you can look into renaming/linking your custom scripts to work like that. What are your naming standards for the custom scripts? Maybe there's something there to be reused... |
|
Thanks a lot. This is more graceful then my idea and still can solve my problem. Thanks for you suggestions. I mainly use some code like the following in the script to obtain the script's pyhisical dirname, basename, and so on:
Regards |
If I want to use this spec for the scripts added by me in the system's /etc/profile.d folder, due to there are some scripts created by system and these scripts are not named after the above spec. So, in this case, the above spec may not ensure the souring order. Any hints for this case?
|


Hi,
Currently, the sourcing order of the customized scripts are controlled by the following code snippet in https://github.com/Bash-it/bash-it/blob/master/bash_it.sh:
But this is not so convenient if we wan to have more control on the sourcing order of the customized scripts.
So, I suggest the following codes for doing the job instead of the above ones:
Any comments on this idea? If you agree, I will make a PR.
Regards