From b5d82de323f8d71b94953c2b46df128fe14f0559 Mon Sep 17 00:00:00 2001 From: 289Adam289 Date: Fri, 20 Dec 2024 12:18:21 +0100 Subject: [PATCH] fix script lint --- scripts/parser-workletization.sh | 9 ++++----- src/libs/SearchParser/autocompleteParser.js | 2 +- src/libs/SearchParser/searchParser.js | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/scripts/parser-workletization.sh b/scripts/parser-workletization.sh index 761153111367..2cb6e715d8ab 100755 --- a/scripts/parser-workletization.sh +++ b/scripts/parser-workletization.sh @@ -7,16 +7,15 @@ filePath=$1 -if [ ! -f $filePath ]; then +if [ ! -f "$filePath" ]; then echo "$filePath does not exist." exit 1 fi -awk 'BEGIN { print "\47worklet\47\n\nclass peg\$SyntaxError{}" } 1' $filePath | sed 's/function peg\$SyntaxError/function temporary/g' | sed 's/peg$subclass(peg$SyntaxError, Error);//g' > tmp.txt -if [ $? -eq 0 ]; then - mv tmp.txt $filePath +if awk 'BEGIN { print "\47worklet\47\n\nclass peg\$SyntaxError{}" } 1' "$filePath" | sed 's/function peg\$SyntaxError/function temporary/g' | sed 's/peg$subclass(peg$SyntaxError, Error);//g' > tmp.txt; then + mv tmp.txt "$filePath" echo "Successfully updated $filePath" else echo "An error occurred while modifying the file." rm -f tmp.txt exit 1 -fi \ No newline at end of file +fi diff --git a/src/libs/SearchParser/autocompleteParser.js b/src/libs/SearchParser/autocompleteParser.js index f410fe58d2b4..557a5590a637 100644 --- a/src/libs/SearchParser/autocompleteParser.js +++ b/src/libs/SearchParser/autocompleteParser.js @@ -351,7 +351,7 @@ function peg$parse(input, options) { var peg$f33 = function() { return "gt"; }; var peg$f34 = function() { return "lte"; }; var peg$f35 = function() { return "lt"; }; - var peg$f36 = function(start, inner, end) { //handle no-breaking-space + var peg$f36 = function(start, inner, end) { //handle no-breaking space return [...start, '"', ...inner, '"', ...end].join(""); }; var peg$f37 = function(chars) { return chars.join("").trim(); }; diff --git a/src/libs/SearchParser/searchParser.js b/src/libs/SearchParser/searchParser.js index 19fcb1a3049e..10b913be74ec 100644 --- a/src/libs/SearchParser/searchParser.js +++ b/src/libs/SearchParser/searchParser.js @@ -310,7 +310,7 @@ function peg$parse(input, options) { var peg$f2 = function(key, op, value) { updateDefaultValues(key, value); }; - var peg$f3 = function(value) { //handle no-breaking-space + var peg$f3 = function(value) { //handle no-breaking space if (Array.isArray(value)) { return buildFilter("eq", "keyword", value.join("")); } @@ -362,7 +362,7 @@ function peg$parse(input, options) { var peg$f34 = function() { return "gt"; }; var peg$f35 = function() { return "lte"; }; var peg$f36 = function() { return "lt"; }; - var peg$f37 = function(start, inner, end) { //handle no-breaking-space + var peg$f37 = function(start, inner, end) { //handle no-breaking space return [...start, '"', ...inner, '"', ...end].join(""); }; var peg$f38 = function(chars) { return chars.join("").trim(); };