Przeglądaj źródła

fix: update script: non-standard version numbers

store version output in new variable
slice output indexed from beginning instead of end. allowing for custom
build version numbers.

also fix weird spacing from tabs being two spaces wide, sorry :)
pull/122/head
Rob Loranger 4 lat temu
rodzic
commit
075f25b829
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: D6F1633A4F0903B8
1 zmienionych plików z 19 dodań i 18 usunięć
  1. +19
    -18
      scripts/upgrade-server.sh

+ 19
- 18
scripts/upgrade-server.sh Wyświetl plik

@@ -1,23 +1,23 @@
#! /bin/bash
###############################################################################
## writefreely update script ##
## ##
## WARNING: running this script will overwrite any modifed assets or ##
## template files. If you have any custom changes to these files you ##
## should back them up FIRST. ##
## ##
## This must be run from the web application root directory ##
## i.e. /var/www/writefreely, and operates under the assumption that you ##
## have not installed the binary `writefreely` in another location. ##
## writefreely update script ##
## ##
## WARNING: running this script will overwrite any modifed assets or ##
## template files. If you have any custom changes to these files you ##
## should back them up FIRST. ##
## ##
## This must be run from the web application root directory ##
## i.e. /var/www/writefreely, and operates under the assumption that you##
## have not installed the binary `writefreely` in another location. ##
###############################################################################
#
# Copyright © 2019 A Bunch Tell LLC.
# Copyright © 2019 A Bunch Tell LLC.
#
# This file is part of WriteFreely.
# This file is part of WriteFreely.
#
# WriteFreely is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, included
# in the LICENSE file in this source code package.
# WriteFreely is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, included
# in the LICENSE file in this source code package.
#


@@ -35,12 +35,13 @@ url=`curl -s https://api.github.com/repos/writeas/writefreely/releases/latest |

# check current version

current=`./writefreely -v`
if [ -z "$current" ]; then
bin_output=`./writefreely -v`
if [ -z "$bin_output" ]; then
exit 1
fi

echo "Current version is v${current:(-5):5}"
current=${bin_output:12:5}
echo "Current version is v$current"

# grab latest version number
IFS='/'
@@ -51,7 +52,7 @@ echo "Latest release is $latest"


IFS='.'
read -ra cv <<< "${current:(-5):5}"
read -ra cv <<< "$current"
read -ra lv <<< "${latest#v}"

IFS=' '


Ładowanie…
Anuluj
Zapisz