mirror of
https://github.com/Karaka-Management/Build.git
synced 2026-02-09 16:08:40 +00:00
Fix variable declaration
This commit is contained in:
parent
180ec55f29
commit
cbf30514ba
|
|
@ -71,8 +71,6 @@ isValidBashScript() {
|
||||||
}
|
}
|
||||||
|
|
||||||
hasInvalidBasicSyntax() {
|
hasInvalidBasicSyntax() {
|
||||||
echo 3
|
|
||||||
echo $1
|
|
||||||
# Check whitespace end of line in code
|
# Check whitespace end of line in code
|
||||||
if [[ -n $(grep -P ' $' "$1") ]]; then
|
if [[ -n $(grep -P ' $' "$1") ]]; then
|
||||||
return 1
|
return 1
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ echo $rootpath
|
||||||
|
|
||||||
if [[ "$FILE" =~ ^.+(sh|js|php|json|css)$ ]]; then
|
if [[ "$FILE" =~ ^.+(sh|js|php|json|css)$ ]]; then
|
||||||
GEN_SYNTAX=$(hasInvalidBasicSyntax "$FILE")
|
GEN_SYNTAX=$(hasInvalidBasicSyntax "$FILE")
|
||||||
|
echo GEN_SYNTAX
|
||||||
|
|
||||||
if [[ $GEN_SYNTAX = 1 ]]; then
|
if [[ $GEN_SYNTAX = 1 ]]; then
|
||||||
echo -e "\e[1;31m\tFound whitespace at end of line in $FILE.\e[0m" >&2
|
echo -e "\e[1;31m\tFound whitespace at end of line in $FILE.\e[0m" >&2
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user