Regular expression in quick install script doesn't work for hugo version 0.100.0 and above. (minor) #5

Open
opened 2022-07-13 16:20:52 +00:00 by svoid · 1 comment

The validation function in the quick install script:
https://codeberg.org/vhs/after-dark/raw/branch/trunk/bin/install

is checking for the correct version of hugo with an outdated regular expression:

re="v(0\d*\.([5-9][1-9]|[6-9])|[1-9]).*"
   if ! hugo version | grep -qE "$re"; then
      echo "Error: After Dark requires Hugo version 0.51 or greater" >&2
      exit 1
   fi

I did some testing and it should work again with the following:

re="v((0\d*\.((10[0-9]|1[1-9]\d|[2-9]\d\d|1000)|[5-9][1-9]|[6-9])|[1-9])\.).*"
   if ! hugo version | grep -qE "$re"; then
      echo "Error: After Dark requires Hugo version 0.51 or greater" >&2
      exit 1
   fi

This should keep the version necessity for 0.51 or greater, but also includes the 100-1000 range. I tried making a pull request, but that doesn't seem to be permitted.

Cheers.

The validation function in the quick install script: https://codeberg.org/vhs/after-dark/raw/branch/trunk/bin/install is checking for the correct version of hugo with an outdated regular expression: ``` re="v(0\d*\.([5-9][1-9]|[6-9])|[1-9]).*" if ! hugo version | grep -qE "$re"; then echo "Error: After Dark requires Hugo version 0.51 or greater" >&2 exit 1 fi ``` I did some testing and it should work again with the following: ``` re="v((0\d*\.((10[0-9]|1[1-9]\d|[2-9]\d\d|1000)|[5-9][1-9]|[6-9])|[1-9])\.).*" if ! hugo version | grep -qE "$re"; then echo "Error: After Dark requires Hugo version 0.51 or greater" >&2 exit 1 fi ``` This should keep the version necessity for 0.51 or greater, but also includes the 100-1000 range. I tried making a pull request, but that doesn't seem to be permitted. Cheers.
svoid changed title from Regular expression in quick install script doesn't work for update versioning 0.100.0 and above. (minor) to Regular expression in quick install script doesn't work for hugo version 0.100.0 and above. (minor) 2022-07-13 16:22:09 +00:00

Thanks for the report. I'm open to pulls to address this. Please ensure any files changed have a copyright line added by the author(s) of the changes in any files with license headers present. Once I've got a block of time to address, I'll keep this need in mind. Sorry I can't be of more help right at this moment. Busy schedule. 🙏

Thanks for the report. I'm open to pulls to address this. Please ensure any files changed have a copyright line added by the author(s) of the changes in any files with license headers present. Once I've got a block of time to address, I'll keep this need in mind. Sorry I can't be of more help right at this moment. Busy schedule. 🙏
Sign in to join this conversation.
There is no content yet.