File size: 658 Bytes
f6ba329
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

# This script runs the build.js script repeatedly until all files are processed

echo "Starting build process..."

# Clear the build output file
> build-output.txt

# Initial run
node build.js | tee -a build-output.txt

# Continue running until all files are processed
while [ $? -eq 0 ] && grep -q "To process the next batch" build-output.txt; do
    # Extract the next command from the output
    NEXT_COMMAND=$(grep -A 1 "To process the next batch" build-output.txt | tail -n 1)
    
    echo "Running next batch: $NEXT_COMMAND"
    
    # Run the next command
    $NEXT_COMMAND | tee -a build-output.txt
done

echo "Build process completed!"