Skip to content

Commit

Permalink
#1833 add node check
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Nov 18, 2024
1 parent 8fa3a23 commit f1d3ddb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions starsky-tools/build-tools/download-mirror-ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,16 @@ echo "$OUTPUT_JSON" > $INDEX_FILE_PATH

echo "All ffmpeg binaries downloaded successfully."

node -e "console.log(JSON.stringify(JSON.parse(require('fs') \
.readFileSync(process.argv[1])), null, 4));" $INDEX_FILE_PATH > $INDEX_FILE_PATH.bak
mv $INDEX_FILE_PATH.bak $INDEX_FILE_PATH
if command -v node &> /dev/null
then
node -e "console.log(JSON.stringify(JSON.parse(require('fs') \
.readFileSync(process.argv[1])), null, 4));" $INDEX_FILE_PATH > $INDEX_FILE_PATH.bak
mv $INDEX_FILE_PATH.bak $INDEX_FILE_PATH
else
echo ""
echo -e "\033[31mWarning: Node.js is not installed. Skipping JSON formatting.\033[0m"
echo ""
fi

for CHECK_FILE in "${CHECK_FILES[@]}"; do
if [ -f "$SCRIPT_DIR$BINARY_FOLDERNAME$CHECK_FILE" ] && [ "$(stat -c%s "$SCRIPT_DIR$BINARY_FOLDERNAME$CHECK_FILE" 2>/dev/null || stat -f%z "$SCRIPT_DIR$BINARY_FOLDERNAME$CHECK_FILE")" -gt 17874368 ]; then
Expand Down

0 comments on commit f1d3ddb

Please sign in to comment.