Commit Graph
10 Commits
Author SHA1 Message Date
Cody Boone Ferguson 01e76d013d Remove no longer true comment in big/sgit
Spaces haven't been a problem for some time but I neglected to copy the
script to the bin/ directory here.
2023-03-03 04:45:08 -08:00
Landon Curt Noll 546498a516 Merge branch 'master' into updates-post-birthday 2023-02-22 20:44:14 -08:00
Cody Boone Ferguson a41636a0ed Comment fixes in sgit 2023-02-16 12:10:23 -08:00
Cody Boone Ferguson 05e83b60ff Bug fix sgit - new version 0.0.5-1 16-02-2023
A problem existed where more than one command would not work (always or
in some conditions depending on the command: not sure which). This
prevented a fix in years.html which will be in the next commit. The sgit
repo has been updated with this fix as well.

The fix is to remove space from IFS and to change "${SED_COMMANDS[*]}"
to be "${SED_COMMANDS[@]}".
2023-02-16 04:38:40 -08:00
Cody Boone Ferguson af32e18f77 New version of sgit - many improvements
Now allows to not overwrite files.

Now allows sed options to be passed to sed.

Allows specifying path to sed.

This script now has its own repo at https://github.com/xexyl/sgit. I
don't expect many people to use it but it seemed like it was worthy of a
repo as it is a pretty handy script (though far from perfect).
2023-02-15 09:08:40 -08:00
Cody Boone Ferguson 1464a25e5a Fix spaces in sed commands in sgit
New version of sgit.

Script now allows for spaces in sed commands. Thus one can do something
like:

    sgit -v3 -x -e 's/web site/website/g'  .

to set verbosity to level 3, turn on tracing (see below) and change
occurrences of 'web site' to be 'website'.

Also added -x option to turn on tracing.
2023-02-15 06:21:10 -08:00
Cody Boone Ferguson a1494028d7 Add a limitation note in sgit
Namely that if the sed command has spaces it will be a problem. Whether
this will be fixed is yet to be seen.
2023-02-13 09:53:39 -08:00
Cody Boone Ferguson c8d9d2eeb9 Minor fix to sgit
Accidentally committed absolute path of sed.

Also it now shows the sed commands with high enough -v level. This is to
help with a strange problem I discovered (not fixed yet).
2023-02-13 08:40:11 -08:00
Cody Boone Ferguson ebd01ebf8d Greatly improve my sgit script
Script no longer requires GNU sed but works with other sed
implementations as well (only other one tested is macOS however).

Uses getopts to parse options. Usage is now:

    usage: sgit [-h] [-V] [-v level] [-e command] <glob...>

	-h                      print help and exit
	-V                      print version and exit
	-v level                set verbosity level
	-e command              append sed command to execute on globs

which means that yes one can specify more than one glob. As long as one
sed command is specified (chose -e to match sed) and one arg is
specified after the last option then the command line is okay (whether
the sed command or file is okay is another matter entirely).

Verbose output to help test / debug features or if just interested in
what's being done.
2023-02-13 06:16:53 -08:00
Landon Curt Noll aa263427e3 added bin directory for misc tools
Added `bin/sgit`.

This directory is NOT intended to become a huge software project
right now.  For now it is just a convenient place to store tools.
Please avoid overthinking, over documenting tools under bin.

Later on there will be a tool that builds links in the web site
from JSON files, perhaps forms HTML files from markdown files, etc.
However we will have to make major progress on issue #1, issue #2,
issue #3 and issue #4 before such code can be written.

In some cases tools put under bin might go away later on
if they are no longer needed.
2023-02-12 17:59:51 -08:00