Skip to content

Commit 7a3ffe6

Browse files
committed
Improve sh to bash
1 parent 11b781a commit 7a3ffe6

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

scripts/pre-commit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ grep -r --include="*.xml" '<mac_address>' userdata/* | grep -v '0123456789AB' &&
33
grep -r --include="*.xml" '<short_id>' userdata/* | grep -v 'abcdefgh' && echo "COMMIT REJECTED, found a real short_id, modify domain_objects and set short_id to abcdefgh!" && exit 1
44
grep -r --include="*.xml" '<wifi_ip>' userdata/* | grep -v '_ip></wifi' | grep -v '127.0.0.1' && echo "COMMIT REJECTED, found a WIFI ip address, modify domain_objects and set wifi_ip to 127.0.0.1!" && exit 1
55
grep -r --include="*.xml" 'lan_ip>' userdata/* | grep -v '_ip></lan' | grep -v '127.0.0.1' && echo "COMMIT REJECTED, found a LAN ip address, modify domain_objects and set lan_ip to 127.0.0.1!" && exit 1
6-
egrep -r --include="*.xml" "([0-9]{1,3}[\.]){3}[0-9]{1,3}" userdata/* | egrep -v '127.0.0.1|0.0.0.0' && echo "COMMIT REJECTED, found ip addresses in the logging, modify domain_objects and set them to 127.0.0.1!" && exit 1
6+
grep -Er --include="*.xml" "([0-9]{1,3}[\.]){3}[0-9]{1,3}" userdata/* | grep -Ev '127.0.0.1|0.0.0.0' && echo "COMMIT REJECTED, found ip addresses in the logging, modify domain_objects and set them to 127.0.0.1!" && exit 1
77
grep -r --include="*.xml" '<hostname>' userdata/* | grep -v 'smile000000' | grep -v 'stretch000000' && echo "COMMIT REJECTED, found a Smile(/Stretch) hostname, modify system_status or domain_objects and set hostname to smile000000!" && exit 1
88
grep -r --include="*.xml" '<longitude>' userdata/* | grep -v '4.49' && echo "COMMIT REJECTED, found your hometown, modify domain_objects and set longitude to 4.49 (that is: Plugwise HQ)!" && exit 1
99
grep -r --include="*.xml" '<latitude>' userdata/* | grep -v '52.21' && echo "COMMIT REJECTED, found your hometown, modify domain_objects and set latitude to 52.21 (that is: Plugwise HQ)!" && exit 1

scripts/tests_and_coverage.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
echo "-----------------------------------------------------------"
33
echo "Running plugwise/smile.py through pytest including coverage"
44
echo "-----------------------------------------------------------"
5-
PYTHONPATH=`pwd` pytest -rpP --log-level debug tests/test_smile.py --cov='.' --no-cov-on-fail
6-
pytest=`echo $?`
7-
echo "-----------------------------------------------------------------"
8-
echo "pytest exit code: ${pytest}"
9-
echo "-----------------------------------------------------------------"
5+
PYTHONPATH=$(pwd) pytest -rpP --log-level debug tests/test_smile.py --cov='.' --no-cov-on-fail

0 commit comments

Comments
 (0)