Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: copy workflow ui scripts from package #1029

Merged
merged 1 commit into from
Nov 18, 2022
Merged
Changes from all commits
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
24 changes: 18 additions & 6 deletions bin/publish_workflow_json.sh → bin/publish_workflow_ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,26 @@ sudo apt-get install jq
# Loop through each package, install from npm and copy the workflow-ui.json from root of the package if it exists
cat site/plugins.json | jq ".[] | select(.workflow == true) | .package" | while read PACKAGE
do
echo "Installing $PACKAGE"
# remove the quotes from the package name
PACKAGE=$(echo $PACKAGE | tr -d '"')
npm install $PACKAGE
if [ -f "node_modules/$PACKAGE/workflow-ui.json" ]; then
echo "Copying workflow-ui.json from $PACKAGE"
cp node_modules/$PACKAGE/workflow-ui.json site/$PACKAGE/workflow-ui.json
echo "Downloading workflow-ui for $PACKAGE"
npm pack $PACKAGE
tar -xzf *.tgz

if [ -f package/workflow-ui.json ]; then
echo "Copying workflow-ui.json for $PACKAGE"
cp package/workflow-ui.json site/$PACKAGE/workflow-ui.json

cat site/$PACKAGE/workflow-ui.json | jq ".surfaces | .[] | .surfaceScripts | .[]" | while read SCRIPT
do
# strip quotes and leading ./ from script path
SCRIPT=$(echo $SCRIPT | tr -d '"' | sed 's/^\.\///')
echo "Copying $SCRIPT for $PACKAGE"
cp package/$SCRIPT site/$PACKAGE/$SCRIPT
done
fi


rm -rf ./package
done

# Add all files to git in the site directory
Expand Down