Fix Jenkins shell compatibility for POSIX sh

- Replace bash [[ ]] with POSIX [ ] syntax
- Use parameter expansion  for prefix checking
- Eliminates "[[: not found" errors in Jenkins logs
- Maintains same functionality with better shell compatibility
This commit is contained in:
RebeccaNod1 2025-08-14 00:45:51 -05:00
parent f693450455
commit 9c73a60f89

4
Jenkinsfile vendored
View file

@ -70,7 +70,7 @@ pipeline {
sh '''
# Only process original source files, not already-processed ones
for file in *.lsl; do
if [ -f "$file" ] && [[ ! "$file" =~ ^processed_ ]]; then
if [ -f "$file" ] && [ "${file#processed_}" = "$file" ]; then
echo "Processing $file..."
python3 ${LSL_TOOLS_PATH}/lsl_preprocessor.py "$file" "processed_$file"
fi
@ -141,7 +141,7 @@ pipeline {
echo "" >> FUNCTIONS.md
for file in *.lsl; do
if [ -f "$file" ] && [[ ! "$file" =~ ^processed_ ]]; then
if [ -f "$file" ] && [ "${file#processed_}" = "$file" ]; then
echo "## $file" >> FUNCTIONS.md
echo "" >> FUNCTIONS.md
grep -n "^[a-zA-Z_][a-zA-Z0-9_]*(" "$file" | head -20 >> FUNCTIONS.md || true