scripts for maintaining scripts
Long ago I created a central place to collect scripts and added it to the PATH so that I could easily start them (a personal /bin so to speak. It's actually called ~/bin). Over the course of time I have collected a lot of small scripts, symlinks and the like in it, and most of them are so minimal hesitate to add them one by one to the repository. So I put them together in a configuration file and created a script to generate the scripts from there, giving two files to be version controlled instead of a lot more. I call the configuration file my "script library" and the entries that ar not symlinks "scriptlets".
being a configuration file, I can also use it to control whether an entry should be active (genaratable) or not, for example a symlink to some tool that is not on my system (anymore, but maybe later) or something that doesn't work (yet).
I made the following commands:
- scriptlib.add
add the contents of an existing scriptlet to the library
- scriptlib.check
compare the contents of an existing scriptlet to what's currently in the library. can also be called with the argument "all", you then get a list with names of the differing scripts; with a specifiec naam you get the actual differences.
- scriptlib.check-ignore
update .gitignore with the (missing) scripts that are in the library. git status may not show such a script as "could be added to the repo". Adding the option --list-only prevents the file from really being updated.
- scriptlib.check-readme
check if all commands in scriptlib are described in readme and show which are not
- scriptlib.disable
remove a scriptlet from the active part of the library (and move it to the inactive part)
- scriptlib.enable
move a scriptlet back to the actieve part of the library
- scriptlib.list-disabled
show all disabled scriptlets
- scriptlib.update
copy a changed script to the library After using scriptlib.check you can use this to get rid of the difference. Here too you can use "all" instead of the actual name(s).