From a43256e802dbfa479046ff29408a397397e2fbe6 Mon Sep 17 00:00:00 2001 From: Bas Stottelaar Date: Wed, 12 Nov 2014 23:22:41 +0100 Subject: [PATCH] Fixed contrib scripts. Added *.pyc cleaning scripts --- contrib/clean_pyc.sh | 9 +++++++++ contrib/downgrade.sh | 14 ++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) create mode 100755 contrib/clean_pyc.sh diff --git a/contrib/clean_pyc.sh b/contrib/clean_pyc.sh new file mode 100755 index 00000000..e3d47e44 --- /dev/null +++ b/contrib/clean_pyc.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Display information +echo "This script will remove *.pyc files. These files are generated by Python, but they can cause conflicts after an upgrade. It's safe to remove them, because they will be regenerated." +echo "Press enter to continue, or CTRL + C to quit." +read + +# Remove the *.pyc +find "`dirname $0`/.." -type f -name "*.pyc" -exec rm -rf {} \; \ No newline at end of file diff --git a/contrib/downgrade.sh b/contrib/downgrade.sh index 7943d0d2..9ff084b9 100755 --- a/contrib/downgrade.sh +++ b/contrib/downgrade.sh @@ -1,14 +1,8 @@ #!/bin/bash # Parameter check -if [ -z "$1" ] || [ -z "$2" ]; then - echo "Syntax: $0 " - exit 1 -fi - -# Repository check -if [ ! -d "$1/.git" ]; then - echo "This script can only downgrade Headphones installations via Git." +if [ -z "$1" ]; then + echo "Syntax: $0 " exit 1 fi @@ -19,7 +13,7 @@ if [ ! -s "$2/version.lock" ]; then fi # Git installation check -if [ ! -x "$(command -v wget)" ]; then +if [ ! -x "$(command -v git)" ]; then echo "Git is required to downgrade." exit 1 fi @@ -32,7 +26,7 @@ echo "Press enter to continue, or CTRL + C to quit." read # Downgrade -cd "$1" +cd "`dirname $0`/.." git reset --hard "$HASH" echo "All done, Headphones should be downgraded to the last version that started." \ No newline at end of file