Some useful scripts, a mixture of bash and zsh
bundleFileswill combine all the files whose names are given as arguments and will combine them into a single file calledbundle.outwhich can then be edited to make changes to all the files in one go. Thebundle.outfile is an executable shell script which when run will unpack all the files into their original versions with the changes applied. You can copy thebundle.outfile before editing it as a backup. You should remember to delete any unwantedbundle.outfiles when you have finished with them.gobannerwill print out any arguments given as a banner but with each line prefixed with a Go line-comment string.shout.alertwill print its arguments as a standard alert message to standard out.shout.headerwill print its arguments as a standard header message to standard out.shout.shortwill print its arguments with leading stars to standard out. Each argument is printed on a separate line with the second and subsequent lines having a greater indent than the first.shout.smallHeaderwill print its arguments as a smaller header message to standard out.makeQScriptwill take the name of a file containing shell commands to be run and will generate a second file with the name of the first file plus.QScript. This new file will have each line surrounded with shell commands that will prompt you to confirm that you want to run the command before running it.semVerLatestwhen run within a git repository will print the highest semantic version ID. NOTE: You must have thesemvertoolscommands somewhere in your PATH.semVerListwhen run within a git repository will list all the tags on the repository correctly sorted as semantic version IDs. NOTE: You must have thesemvertoolscommands somewhere in your PATH.semVerNextwhen run within a git repository will find the highest valid semantic version number and increment it. By default it will increment the patch version but you can supply arguments to change this:-part minorwill increment the minor version and-part majorwill increment the major number. NOTE: You must have thesemvertoolscommands somewhere in your PATH.semVerUpdGoModToLatestwhen run within a git repository will find the latest versions of the required modules and prompt you to upgrade to them. NOTE: You must have thesemvertoolscommands somewhere in your PATH.YNQ.funcis a function definition that can be loaded into scripts and it provides a utility function that prints a prompt, reads a reply and optionally executes a command. According to the value of the reply it will either skip the command, quit the script or run the command.
First get these scripts from git
git clone ssh://git@github.com/nickwells/shell.scripts
At this point the scripts will not have the execute bit set so there is a script provided that you can dot into your shell in order to make the scripts executable. It will also check that some of the tools needed have also been installed and warn you if not. Run the initialise script as follows:
. initialise.shell.scripts