diff --git a/scripts/chromium.sh b/scripts/chromium.sh index 9cd42a896..2ac52f838 100644 --- a/scripts/chromium.sh +++ b/scripts/chromium.sh @@ -21,18 +21,19 @@ bash ./scripts/copy_common.sh $DES cp platform_spec/chromium/manifest.json $DES cd $DES +commit_num=$(git rev-list HEAD --count) if [[ $# -eq 0 ]]; then echo "*** FastForward.Chromium: Creating dev package... (Tip: Use nover to create a no-version package)" bash ../../scripts/version.sh manifest.json 0 - zip -qr ../$(basename $DIST)/FastForward_chromium_$(git shortlog | grep -E '^[ ]+\w+' | wc -l)_dev.zip . + zip -qr ../$(basename $DIST)/FastForward_chromium_${commit_num}_dev.zip . elif [ "$1" == "nover" ] ; then echo "*** FastForward.Chromium: Creating non-versioned package... " rm injection_script.js rm rules.json bash ../../scripts/version.sh manifest.json nover - zip -qr ../$(basename $DIST)/FastForward_chromium_0.$(git shortlog | grep -E '^[ ]+\w+' | wc -l).zip . + zip -qr ../$(basename $DIST)/FastForward_chromium_0.${commit_num}.zip . elif [ "$1" == "ver" ]; then echo "*** FastForward.Chromium: Creating versioned package... " diff --git a/scripts/firefox.sh b/scripts/firefox.sh index 53d430164..9a4382e94 100644 --- a/scripts/firefox.sh +++ b/scripts/firefox.sh @@ -21,18 +21,19 @@ bash ./scripts/copy_common.sh $DES cp platform_spec/firefox/manifest.json $DES cd $DES +commit_num=$(git rev-list HEAD --count) if [[ $# -eq 0 ]]; then echo "*** FastForward.firefox: Creating dev package... (Tip: Use nover to create a no-version package)" bash ../../scripts/version.sh manifest.json 0 - zip -qr ../$(basename $DIST)/FastForward_firefox_$(git shortlog | grep -E '^[ ]+\w+' | wc -l)_dev.xpi . + zip -qr ../$(basename $DIST)/FastForward_firefox_${commit_num}_dev.xpi . elif [ "$1" == "nover" ] ; then echo "*** FastForward.firefox: Creating non-versioned package... " rm injection_script.js rm rules.json bash ../../scripts/version.sh manifest.json nover - zip -qr ../$(basename $DIST)/FastForward_firefox_0.$(git shortlog | grep -E '^[ ]+\w+' | wc -l).xpi . + zip -qr ../$(basename $DIST)/FastForward_firefox_0.$commit_num.xpi . elif [ "$1" == "ver" ]; then echo "*** FastForward.firefox: Creating versioned package... " diff --git a/scripts/version.sh b/scripts/version.sh index 8766099c7..55b09530a 100644 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -5,6 +5,7 @@ set -e manifest_loc=$1 +commit_num=$(git rev-list HEAD --count) if [[ $# -lt 2 ]]; then #Creates a normal versioned json using only version.txt @@ -15,13 +16,13 @@ if [[ $# -lt 2 ]]; then #Creates a normal versioned json using only version.txt elif [ "$2" = "nover" ]; then #Creates a non-versioned json using only number of commits - version="0.$(git shortlog | grep -E '^[ ]+\w+' | wc -l)" + version="0.$commit_num" sed -i '/"version":/c\ "version": "'$version'",' $1 echo vesrioned $(basename $1) to $version else #Creates a json using the number of commits and appends the second argument to it - version="0.$(git shortlog | grep -E '^[ ]+\w+' | wc -l).$2" + version="0.$commit_num.$2" sed -i '/"version":/c\ "version": "'$version'",' $1 echo vesrioned $(basename $1) to $version fi