mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
add check for windows eol on commit
removes windows eols from some files
This commit is contained in:
18
scripts/checkeol.sh
Executable file
18
scripts/checkeol.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function checkEOL {
|
||||||
|
local changedFiles=$(git --no-pager diff --name-only -M100% --diff-filter=AM --relative $(git merge-base FETCH_HEAD origin/HEAD) FETCH_HEAD)
|
||||||
|
local result=0
|
||||||
|
for name in $changedFiles; do
|
||||||
|
grep -c -U -q $'\r' $name
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "windows eol found in $name" >&2
|
||||||
|
result=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ $result -eq 1 ]; then
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
checkEOL
|
||||||
@@ -3,6 +3,10 @@
|
|||||||
NODE_INDEX="$1"
|
NODE_INDEX="$1"
|
||||||
TOTAL_NODES="$2"
|
TOTAL_NODES="$2"
|
||||||
|
|
||||||
|
function checkEOL {
|
||||||
|
./scripts/checkeol.sh
|
||||||
|
}
|
||||||
|
|
||||||
typecheck() {
|
typecheck() {
|
||||||
npm install -g flow-bin
|
npm install -g flow-bin
|
||||||
flow --version
|
flow --version
|
||||||
@@ -47,6 +51,7 @@ doctest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
oneNode() {
|
oneNode() {
|
||||||
|
checkEOL
|
||||||
doctest
|
doctest
|
||||||
lint
|
lint
|
||||||
typecheck
|
typecheck
|
||||||
@@ -57,7 +62,7 @@ oneNode() {
|
|||||||
twoNodes() {
|
twoNodes() {
|
||||||
case "$NODE_INDEX" in
|
case "$NODE_INDEX" in
|
||||||
0) doctest; lint; integrationtest;;
|
0) doctest; lint; integrationtest;;
|
||||||
1) typecheck; unittest;;
|
1) checkEOL; typecheck; unittest;;
|
||||||
*) echo "ERROR: invalid usage"; exit 2;;
|
*) echo "ERROR: invalid usage"; exit 2;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -65,7 +70,7 @@ twoNodes() {
|
|||||||
threeNodes() {
|
threeNodes() {
|
||||||
case "$NODE_INDEX" in
|
case "$NODE_INDEX" in
|
||||||
0) doctest; lint; integrationtest;;
|
0) doctest; lint; integrationtest;;
|
||||||
1) typecheck;;
|
1) checkEOL; typecheck;;
|
||||||
2) unittest;;
|
2) unittest;;
|
||||||
*) echo "ERROR: invalid usage"; exit 2;;
|
*) echo "ERROR: invalid usage"; exit 2;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user