Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions scripts/update-testRunner-resources.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -e

# Go to project root
cd "$(dirname -- "$0")/.."

# Download latest files
cd lib/middleware/testRunner
curl -L -O https://github.com/SAP/openui5/raw/master/src/sap.ui.core/test/sap/ui/qunit/TestRunner.js
curl -L -O https://github.com/SAP/openui5/raw/master/src/sap.ui.core/test/sap/ui/qunit/testrunner.css
curl -L -O https://github.com/SAP/openui5/raw/master/src/sap.ui.core/test/sap/ui/qunit/testrunner.html

# Check if there are updates
git diff --quiet && echo "No updates. Exiting..." && exit 0

# Get latest commit url for src/sap.ui.core/test/sap/ui/qunit path
COMMIT_URL=$(curl "https://api.github.com/repos/SAP/openui5/commits?sha=master&path=src/sap.ui.core/test/sap/ui/qunit" | \
node -r fs -e "process.stdout.write(JSON.parse(fs.readFileSync(\"/dev/stdin\", \"utf8\"))[0].html_url)")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative would be jq. Needs to be installed however


echo "Creating new commit..."

# Add changes and create commit
git add .
git commit \
-m "[FIX] middleware/testRunner: Update resources from OpenUI5" \
-m "Based on:
$COMMIT_URL"