From 320d9a2a651c4083977288d0e1a6630ca79cf424 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Wed, 7 Apr 2021 18:03:30 -0700 Subject: [PATCH 01/25] upgrade changelog compare (fixes #2164) --- modules/changelog.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index 5b2c431602..b58f9a8923 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -29,11 +29,22 @@ case "$displaymode" in case "$version2" in "") checkargn $# 2 - sed "/^### $CURRENT/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH #grabs text between version numbers, print bottom to top + if [[ $CURRENT > $version1 ]]; then + sed "/^### $CURRENT/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH #grabs text between version numbers, print bottom to top + else # Needs to specify previous version instead of current + echo "ERROR: Must specify a previous version (less than $CURRENT)" + esac ;; *) checkargn $# 3 - sed "/^### $version2/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH + if [[ $version2 > $version1 ]]; then + sed "/^### $version2/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH + elif [[ $version2 -q $version1 ]]; then + echo "ERROR: Must specify different versions for comparisons (cannot compare same version to itself)" + else + sed "/^### $version1/!d;s//&\n/;s/.*\n//;:a;/^### $version2/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH + echo "Did you mean: $BASENAME changelog compare $version2 $version1" + esac ;; esac ;; From ea576a1e76083a086eb14b03280bf7eaf17da14a Mon Sep 17 00:00:00 2001 From: JLKwong Date: Wed, 7 Apr 2021 18:08:08 -0700 Subject: [PATCH 02/25] upgrade changelog compare (fixes #2164) --- modules/changelog.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index b58f9a8923..bfa68ca707 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -33,7 +33,7 @@ case "$displaymode" in sed "/^### $CURRENT/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH #grabs text between version numbers, print bottom to top else # Needs to specify previous version instead of current echo "ERROR: Must specify a previous version (less than $CURRENT)" - esac + fi ;; *) checkargn $# 3 @@ -44,7 +44,7 @@ case "$displaymode" in else sed "/^### $version1/!d;s//&\n/;s/.*\n//;:a;/^### $version2/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH echo "Did you mean: $BASENAME changelog compare $version2 $version1" - esac + fi ;; esac ;; From 66a119ba1540acbe0178e5d9ac9d78f035bd9fa5 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Wed, 7 Apr 2021 18:13:45 -0700 Subject: [PATCH 03/25] upgrade changelog compare (fixes #2164) --- modules/changelog.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index bfa68ca707..05ea3a347a 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -29,7 +29,7 @@ case "$displaymode" in case "$version2" in "") checkargn $# 2 - if [[ $CURRENT > $version1 ]]; then + if [[ "$CURRENT" > "$version1" ]]; then sed "/^### $CURRENT/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH #grabs text between version numbers, print bottom to top else # Needs to specify previous version instead of current echo "ERROR: Must specify a previous version (less than $CURRENT)" @@ -37,9 +37,9 @@ case "$displaymode" in ;; *) checkargn $# 3 - if [[ $version2 > $version1 ]]; then + if [[ "$version2" > "$version1" ]]; then sed "/^### $version2/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH - elif [[ $version2 -q $version1 ]]; then + elif [[ "$version2" -q "$version1" ]]; then echo "ERROR: Must specify different versions for comparisons (cannot compare same version to itself)" else sed "/^### $version1/!d;s//&\n/;s/.*\n//;:a;/^### $version2/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH From d9d1e509e82347cc136bd62b58b3264e76f5ade4 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Wed, 7 Apr 2021 18:14:22 -0700 Subject: [PATCH 04/25] upgrade changelog compare (fixes #2164) --- modules/changelog.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index 05ea3a347a..d1a2fc0814 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -39,7 +39,7 @@ case "$displaymode" in checkargn $# 3 if [[ "$version2" > "$version1" ]]; then sed "/^### $version2/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH - elif [[ "$version2" -q "$version1" ]]; then + elif [[ "$version2" = "$version1" ]]; then echo "ERROR: Must specify different versions for comparisons (cannot compare same version to itself)" else sed "/^### $version1/!d;s//&\n/;s/.*\n//;:a;/^### $version2/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH From b809362c2fb7b678d63113d13b3b94d59f0b15de Mon Sep 17 00:00:00 2001 From: JLKwong Date: Wed, 7 Apr 2021 18:38:31 -0700 Subject: [PATCH 05/25] debug --- modules/changelog.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index d1a2fc0814..9db46eef13 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -29,7 +29,7 @@ case "$displaymode" in case "$version2" in "") checkargn $# 2 - if [[ "$CURRENT" > "$version1" ]]; then + if [[ $CURRENT > $version1 ]]; then sed "/^### $CURRENT/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH #grabs text between version numbers, print bottom to top else # Needs to specify previous version instead of current echo "ERROR: Must specify a previous version (less than $CURRENT)" @@ -37,9 +37,9 @@ case "$displaymode" in ;; *) checkargn $# 3 - if [[ "$version2" > "$version1" ]]; then + if [[ $version2 > $version1 ]]; then sed "/^### $version2/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH - elif [[ "$version2" = "$version1" ]]; then + elif [[ $version2 = $version1 ]]; then echo "ERROR: Must specify different versions for comparisons (cannot compare same version to itself)" else sed "/^### $version1/!d;s//&\n/;s/.*\n//;:a;/^### $version2/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH From ae9630f82943a11b3ed2c1df7bc71fd2400015f1 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Wed, 7 Apr 2021 19:55:00 -0700 Subject: [PATCH 06/25] debug --- modules/changelog.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index 9db46eef13..148c373dae 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -28,18 +28,26 @@ case "$displaymode" in *) case "$version2" in "") + CURA=$(echo $CURRENT | cut -d "." 1-2) + CURB=$(echo $CURRENT | cut -d "." 3) + VER1A=$(echo $version1 | cut -d "." 1-2) + VER1B=$(echo $version1 | cut -d "." 3) checkargn $# 2 - if [[ $CURRENT > $version1 ]]; then + if [[ $CURA -gt $VER1A ]] || [[ $CURA -eq $VER1A && $CURB -gt $VER1B ]]; then sed "/^### $CURRENT/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH #grabs text between version numbers, print bottom to top else # Needs to specify previous version instead of current echo "ERROR: Must specify a previous version (less than $CURRENT)" fi ;; *) + VER2A=$(echo $version2 | cut -d "." 1-2) + VER2B=$(echo $version2 | cut -d "." 3) + VER1A=$(echo $version1 | cut -d "." 1-2) + VER1B=$(echo $version1 | cut -d "." 3) checkargn $# 3 - if [[ $version2 > $version1 ]]; then + if [[ $VER2A -gt $VER1A ]] || [[ $VER2A -eq $VER1A && $VER2B -gt $VER1B ]]; then sed "/^### $version2/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH - elif [[ $version2 = $version1 ]]; then + elif [[ $VER2A -eq $VER1A && $VER2B -eq $VER1B ]]; then echo "ERROR: Must specify different versions for comparisons (cannot compare same version to itself)" else sed "/^### $version1/!d;s//&\n/;s/.*\n//;:a;/^### $version2/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH From 6ebf5ab5bf4a3397f5af46b79aa76c31b8d22baa Mon Sep 17 00:00:00 2001 From: JLKwong Date: Wed, 7 Apr 2021 20:01:20 -0700 Subject: [PATCH 07/25] debug --- modules/changelog.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/changelog.sh b/modules/changelog.sh index 148c373dae..b939f900ee 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -38,6 +38,10 @@ case "$displaymode" in else # Needs to specify previous version instead of current echo "ERROR: Must specify a previous version (less than $CURRENT)" fi + echo " CURA: $CURA" + echo " CURB: $CURB" + echo " VER1A: $VER1A" + echo " VER1B: $VER1B" ;; *) VER2A=$(echo $version2 | cut -d "." 1-2) From 1a23f3968baa1a687f80faa8e49b3f11fd9a97bf Mon Sep 17 00:00:00 2001 From: JLKwong Date: Fri, 9 Apr 2021 15:09:48 -0700 Subject: [PATCH 08/25] add changelog.md for debugging --- modules/changelog.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/changelog.sh b/modules/changelog.sh index b939f900ee..8307739887 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -1,4 +1,5 @@ function changelog { +cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" ../. local LOGPATH displaymode version1 version2 CURRENT CURRENT=$(treehouses version) LOGPATH="$SCRIPTFOLDER/CHANGELOG.md" From c31a1c9f80947d50f3a8198148a1e04d67f0647f Mon Sep 17 00:00:00 2001 From: JLKwong Date: Fri, 9 Apr 2021 15:55:08 -0700 Subject: [PATCH 09/25] add changelog.md for debugging --- modules/changelog.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index 8307739887..e8b3f1df7e 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -1,5 +1,6 @@ function changelog { cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" ../. +cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" . local LOGPATH displaymode version1 version2 CURRENT CURRENT=$(treehouses version) LOGPATH="$SCRIPTFOLDER/CHANGELOG.md" @@ -16,7 +17,7 @@ case "$displaymode" in view) checkargn $# 1 view $LOGPATH - ;; + ;; "") checkargn $# 0 cat $LOGPATH @@ -39,18 +40,10 @@ case "$displaymode" in else # Needs to specify previous version instead of current echo "ERROR: Must specify a previous version (less than $CURRENT)" fi - echo " CURA: $CURA" - echo " CURB: $CURB" - echo " VER1A: $VER1A" - echo " VER1B: $VER1B" ;; *) - VER2A=$(echo $version2 | cut -d "." 1-2) - VER2B=$(echo $version2 | cut -d "." 3) - VER1A=$(echo $version1 | cut -d "." 1-2) - VER1B=$(echo $version1 | cut -d "." 3) checkargn $# 3 - if [[ $VER2A -gt $VER1A ]] || [[ $VER2A -eq $VER1A && $VER2B -gt $VER1B ]]; then + if [[ $(dpkg --compare-versions "$version2" "gt" "$version1") -eq 0 ]] || [[ $VER2A -eq $VER1A && $VER2B -gt $VER1B ]]; then sed "/^### $version2/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH elif [[ $VER2A -eq $VER1A && $VER2B -eq $VER1B ]]; then echo "ERROR: Must specify different versions for comparisons (cannot compare same version to itself)" From 6e9c579d5cfa4c8936c57434e9a59a657a495fc8 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Fri, 9 Apr 2021 15:58:17 -0700 Subject: [PATCH 10/25] add changelog.md for debugging --- modules/changelog.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index e8b3f1df7e..55535f2b07 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -17,7 +17,7 @@ case "$displaymode" in view) checkargn $# 1 view $LOGPATH - ;; + ;; "") checkargn $# 0 cat $LOGPATH From 51d22cfc7341ae9a1b871000e2122f0d4107426d Mon Sep 17 00:00:00 2001 From: JLKwong Date: Fri, 9 Apr 2021 17:02:26 -0700 Subject: [PATCH 11/25] add debian compare versions --- modules/changelog.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index 55535f2b07..63515e15f5 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -30,12 +30,8 @@ case "$displaymode" in *) case "$version2" in "") - CURA=$(echo $CURRENT | cut -d "." 1-2) - CURB=$(echo $CURRENT | cut -d "." 3) - VER1A=$(echo $version1 | cut -d "." 1-2) - VER1B=$(echo $version1 | cut -d "." 3) checkargn $# 2 - if [[ $CURA -gt $VER1A ]] || [[ $CURA -eq $VER1A && $CURB -gt $VER1B ]]; then + if [ dpkg --compare-versions "$CURRENT" "gt" "$version1" ]; then sed "/^### $CURRENT/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH #grabs text between version numbers, print bottom to top else # Needs to specify previous version instead of current echo "ERROR: Must specify a previous version (less than $CURRENT)" @@ -43,9 +39,9 @@ case "$displaymode" in ;; *) checkargn $# 3 - if [[ $(dpkg --compare-versions "$version2" "gt" "$version1") -eq 0 ]] || [[ $VER2A -eq $VER1A && $VER2B -gt $VER1B ]]; then + if [ dpkg --compare-versions "$version2" "gt" "$version1" ]; then sed "/^### $version2/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH - elif [[ $VER2A -eq $VER1A && $VER2B -eq $VER1B ]]; then + elif [ dpkg --compare-versions "$version2" "eq" "$version1" ]; then echo "ERROR: Must specify different versions for comparisons (cannot compare same version to itself)" else sed "/^### $version1/!d;s//&\n/;s/.*\n//;:a;/^### $version2/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH From 8a5fb521ebb073074c15c3517f20848be00966d8 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Fri, 9 Apr 2021 17:09:46 -0700 Subject: [PATCH 12/25] add debian compare versions --- modules/changelog.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index 63515e15f5..31e029642e 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -31,7 +31,7 @@ case "$displaymode" in case "$version2" in "") checkargn $# 2 - if [ dpkg --compare-versions "$CURRENT" "gt" "$version1" ]; then + if [ dpkg --compare-versions "$CURRENT" "gt" "$version1" | echo $? -eq 0 ]; then sed "/^### $CURRENT/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH #grabs text between version numbers, print bottom to top else # Needs to specify previous version instead of current echo "ERROR: Must specify a previous version (less than $CURRENT)" From be9ee233cfbc4c45a4e2e06387433ed0471463ba Mon Sep 17 00:00:00 2001 From: JLKwong Date: Fri, 9 Apr 2021 17:12:19 -0700 Subject: [PATCH 13/25] add debian compare versions --- modules/changelog.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index 31e029642e..8016edc09a 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -31,7 +31,7 @@ case "$displaymode" in case "$version2" in "") checkargn $# 2 - if [ dpkg --compare-versions "$CURRENT" "gt" "$version1" | echo $? -eq 0 ]; then + if [[ dpkg --compare-versions "$CURRENT" "gt" "$version1" | echo $? -eq 0 ]]; then sed "/^### $CURRENT/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH #grabs text between version numbers, print bottom to top else # Needs to specify previous version instead of current echo "ERROR: Must specify a previous version (less than $CURRENT)" From 62a22ccffdbc1a3324344514b4a8c8b8a5269650 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Fri, 9 Apr 2021 17:14:15 -0700 Subject: [PATCH 14/25] add debian compare versions --- modules/changelog.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index 8016edc09a..07607e67a7 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -31,7 +31,9 @@ case "$displaymode" in case "$version2" in "") checkargn $# 2 - if [[ dpkg --compare-versions "$CURRENT" "gt" "$version1" | echo $? -eq 0 ]]; then + dpkg --compare-versions "$CURRENT" "gt" "$version1") + compare=$(echo $?) + if [[ $compare -eq 0 ]]; then sed "/^### $CURRENT/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH #grabs text between version numbers, print bottom to top else # Needs to specify previous version instead of current echo "ERROR: Must specify a previous version (less than $CURRENT)" From 7ce67432a75fa25a505f17fda523b75e7ff7fed1 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Fri, 9 Apr 2021 17:14:47 -0700 Subject: [PATCH 15/25] debug debian compare versions --- modules/changelog.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index 07607e67a7..f53146933a 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -31,7 +31,7 @@ case "$displaymode" in case "$version2" in "") checkargn $# 2 - dpkg --compare-versions "$CURRENT" "gt" "$version1") + dpkg --compare-versions "$CURRENT" "gt" "$version1" compare=$(echo $?) if [[ $compare -eq 0 ]]; then sed "/^### $CURRENT/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH #grabs text between version numbers, print bottom to top From 7eccf1c46df3577ce1b486ad9383eea1368d50f9 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Fri, 9 Apr 2021 17:21:48 -0700 Subject: [PATCH 16/25] debug debian compare versions --- modules/changelog.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index f53146933a..9d58c542cb 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -32,8 +32,8 @@ case "$displaymode" in "") checkargn $# 2 dpkg --compare-versions "$CURRENT" "gt" "$version1" - compare=$(echo $?) - if [[ $compare -eq 0 ]]; then + gt=$(echo $?) + if [[ $gt -eq 0 ]]; then sed "/^### $CURRENT/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH #grabs text between version numbers, print bottom to top else # Needs to specify previous version instead of current echo "ERROR: Must specify a previous version (less than $CURRENT)" @@ -41,9 +41,13 @@ case "$displaymode" in ;; *) checkargn $# 3 - if [ dpkg --compare-versions "$version2" "gt" "$version1" ]; then + dpkg --compare-versions "$version2" "gt" "$version1" + gt=$(echo $?) + dpkg --compare-versions "$version2" "eq" "$version1" + eq=$(echo $?) + if [[ $gt -eq 0 ]]; then sed "/^### $version2/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH - elif [ dpkg --compare-versions "$version2" "eq" "$version1" ]; then + elif [[ $eq -eq 0 ]]; then echo "ERROR: Must specify different versions for comparisons (cannot compare same version to itself)" else sed "/^### $version1/!d;s//&\n/;s/.*\n//;:a;/^### $version2/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH From 7acbea968ade68519275c575e6479b65ae6acf56 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Fri, 9 Apr 2021 17:25:51 -0700 Subject: [PATCH 17/25] debug debian compare versions --- modules/changelog.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index 9d58c542cb..ae5b5fd77a 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -32,7 +32,7 @@ case "$displaymode" in "") checkargn $# 2 dpkg --compare-versions "$CURRENT" "gt" "$version1" - gt=$(echo $?) + gt="$?" if [[ $gt -eq 0 ]]; then sed "/^### $CURRENT/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH #grabs text between version numbers, print bottom to top else # Needs to specify previous version instead of current @@ -42,9 +42,9 @@ case "$displaymode" in *) checkargn $# 3 dpkg --compare-versions "$version2" "gt" "$version1" - gt=$(echo $?) + gt="$?" dpkg --compare-versions "$version2" "eq" "$version1" - eq=$(echo $?) + eq="$?" if [[ $gt -eq 0 ]]; then sed "/^### $version2/!d;s//&\n/;s/.*\n//;:a;/^### $version1/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH elif [[ $eq -eq 0 ]]; then From 8afc2b59cc67ab63ffcd33a70114632ad69f64da Mon Sep 17 00:00:00 2001 From: JLKwong Date: Fri, 9 Apr 2021 17:45:30 -0700 Subject: [PATCH 18/25] check directory --- modules/changelog.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index ae5b5fd77a..c9dd233df0 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -1,6 +1,9 @@ function changelog { -cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" ../. -cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" . +if [ -d "tests" ] + cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" . +else + cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" ../. +fi local LOGPATH displaymode version1 version2 CURRENT CURRENT=$(treehouses version) LOGPATH="$SCRIPTFOLDER/CHANGELOG.md" From f11831084faa7f24e1913bc7330321ca40b1146b Mon Sep 17 00:00:00 2001 From: JLKwong Date: Fri, 9 Apr 2021 17:47:19 -0700 Subject: [PATCH 19/25] check directory --- modules/changelog.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index c9dd233df0..d53b5cfad9 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -1,5 +1,5 @@ function changelog { -if [ -d "tests" ] +if [ -d "tests" ]; then cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" . else cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" ../. From 3f627c0f4bea8612db6e6ad9492ba0de6c570b88 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Thu, 22 Apr 2021 21:28:02 -0700 Subject: [PATCH 20/25] remove duplicate CHANGELOG --- modules/changelog.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/changelog.sh b/modules/changelog.sh index d53b5cfad9..60726f7d6a 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -1,8 +1,10 @@ function changelog { if [ -d "tests" ]; then cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" . + rm "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" else cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" ../. + rm "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" fi local LOGPATH displaymode version1 version2 CURRENT CURRENT=$(treehouses version) From b0024461d2fdfe59e4ea574c312e324719fdd73b Mon Sep 17 00:00:00 2001 From: JLKwong Date: Thu, 22 Apr 2021 21:45:52 -0700 Subject: [PATCH 21/25] remove duplicate CHANGELOG --- modules/changelog.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index 60726f7d6a..c083564aca 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -1,10 +1,10 @@ function changelog { if [ -d "tests" ]; then cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" . - rm "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" + rm "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" || true else cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" ../. - rm "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" + rm "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" || true fi local LOGPATH displaymode version1 version2 CURRENT CURRENT=$(treehouses version) From b02f984d99a6834492b28c55420378d18a09a758 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Thu, 22 Apr 2021 21:47:12 -0700 Subject: [PATCH 22/25] remove duplicate CHANGELOG --- modules/changelog.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index c083564aca..0e14bb6392 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -1,10 +1,10 @@ function changelog { if [ -d "tests" ]; then - cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" . - rm "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" || true + cp -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" . + rm -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" else - cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" ../. - rm "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" || true + cp -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" ../. + rm -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" fi local LOGPATH displaymode version1 version2 CURRENT CURRENT=$(treehouses version) From f030e906457e89d1e15bc5a947894812963b2469 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Thu, 22 Apr 2021 21:48:47 -0700 Subject: [PATCH 23/25] remove duplicate CHANGELOG --- modules/changelog.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index 0e14bb6392..900d186863 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -1,9 +1,9 @@ function changelog { if [ -d "tests" ]; then - cp -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" . + cp -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" . 2>/dev/null || true rm -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" else - cp -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" ../. + cp -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" ../. 2>/dev/null || true rm -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" fi local LOGPATH displaymode version1 version2 CURRENT From d4329e8e4c39946c94667ec5f1a0e2038623cb02 Mon Sep 17 00:00:00 2001 From: JLKwong <61807745+JLKwong@users.noreply.github.com> Date: Wed, 28 Apr 2021 02:13:49 -0700 Subject: [PATCH 24/25] Update changelog.sh --- modules/changelog.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index 900d186863..2c2efbc84b 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -56,7 +56,6 @@ case "$displaymode" in echo "ERROR: Must specify different versions for comparisons (cannot compare same version to itself)" else sed "/^### $version1/!d;s//&\n/;s/.*\n//;:a;/^### $version2/bb;\$!{n;ba};:b;s//\n&/;P;D" $LOGPATH - echo "Did you mean: $BASENAME changelog compare $version2 $version1" fi ;; esac From 8e12397cf9d0594cd3b16fbcc75885f4af29b292 Mon Sep 17 00:00:00 2001 From: JLKwong <61807745+JLKwong@users.noreply.github.com> Date: Sun, 2 May 2021 20:33:17 -0700 Subject: [PATCH 25/25] Update changelog.sh --- modules/changelog.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/modules/changelog.sh b/modules/changelog.sh index 2c2efbc84b..9a7c4a6052 100644 --- a/modules/changelog.sh +++ b/modules/changelog.sh @@ -1,11 +1,4 @@ function changelog { -if [ -d "tests" ]; then - cp -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" . 2>/dev/null || true - rm -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" -else - cp -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" ../. 2>/dev/null || true - rm -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" -fi local LOGPATH displaymode version1 version2 CURRENT CURRENT=$(treehouses version) LOGPATH="$SCRIPTFOLDER/CHANGELOG.md"