Browse Source

fix(bin/upgrade): properly detect current theme version, if present

Josh Habdas 4 months ago
parent
commit
59cebcbe3a
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      bin/upgrade

+ 1
- 1
bin/upgrade View File

@@ -37,7 +37,7 @@ generate_help_docs () {
37 37
 update_module () {
38 38
    meta_file=themes/"$1"/data/npm/latest.json
39 39
    if [ -f "$meta_file" ] ; then
40
-      current_vers=$(echo "$meta_file" | grep -oE "\"version\".*[^,]*," | cut -d ',' -f1 | cut -d ':' -f2 | tr -d '" ')
40
+      current_vers=$(sed -n 's/.*"version":"\([^"]*\).*/\1/p' < "$meta_file")
41 41
    else
42 42
       echo "Cannot detect version. Upgrade $1 anyway (y/n)? \c"
43 43
       read -r answer

Loading…
Cancel
Save