mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-22 15:58:46 +00:00
feat(tools/check_qml): use as git pre-commit hook
This commit is contained in:
parent
60a42f1deb
commit
580347cd0f
1 changed files with 15 additions and 3 deletions
|
|
@ -7,14 +7,26 @@
|
||||||
RESOURCES_FILE="resources.qrc"
|
RESOURCES_FILE="resources.qrc"
|
||||||
LINTER=qmllint-qt5
|
LINTER=qmllint-qt5
|
||||||
|
|
||||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
||||||
cd $SCRIPT_DIR/..
|
|
||||||
|
|
||||||
RED='\e[1;31m'
|
RED='\e[1;31m'
|
||||||
GREEN='\e[1;32m'
|
GREEN='\e[1;32m'
|
||||||
BLUE='\e[1;34m'
|
BLUE='\e[1;34m'
|
||||||
NC='\e[0m'
|
NC='\e[0m'
|
||||||
|
|
||||||
|
function go_to_source_file_dir {
|
||||||
|
# See: http://stackoverflow.com/questions/59895/can-a-bash-script-tell-which-directory-it-is-stored-in
|
||||||
|
SOURCE="${BASH_SOURCE[0]}"
|
||||||
|
while [ -h "$SOURCE" ]; do
|
||||||
|
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||||
|
SOURCE="$(readlink "$SOURCE")"
|
||||||
|
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
|
||||||
|
done
|
||||||
|
SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||||
|
|
||||||
|
cd $SCRIPT_DIR/..
|
||||||
|
}
|
||||||
|
|
||||||
|
go_to_source_file_dir
|
||||||
|
|
||||||
printf "${BLUE}Checking qml files...${NC}\n"
|
printf "${BLUE}Checking qml files...${NC}\n"
|
||||||
|
|
||||||
so_far_so_good=0
|
so_far_so_good=0
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue