Skip to content

Commit

Permalink
Merge pull request #189 from Shopify/improve-build-consumer-spin
Browse files Browse the repository at this point in the history
chore: update build-consumer and restore-consumer for spin to work with short form workspace name
  • Loading branch information
vividviolet authored Aug 11, 2021
2 parents 1b1361e + 8264de4 commit 6ffaedb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions scripts/build-consumer-spin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
. "$PWD/scripts/consumer-helper.sh"

usage="
Usage: $(basename "$0") <workspace> [<package_name>]
Usage: $(basename "$0") <workspace short name> [<package_name>]
Build UI Extensions packages into a project
<workspace> Target spin workspace, i.e. \`web.test.trish-ta.us.spin.dev\`
<workspace short name> Target spin workspace short name, i.e. only enter \`web\` if your workspace is \`web.test.trish-ta.us.spin.dev\`
<package_name> Space separated package names
default: ${AVAILABLE_PACKAGES[@]}
Expand Down
6 changes: 3 additions & 3 deletions scripts/consumer-helper.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

AVAILABLE_PACKAGES=('admin-ui-extensions' 'admin-ui-extensions-react' 'checkout-ui-extensions', 'checkout-ui-extensions-react', 'post-purchase-ui-extensions', 'post-purchase-ui-extensions-react', 'checkout-ui-extensions-run')
AVAILABLE_PACKAGES=('admin-ui-extensions' 'admin-ui-extensions-react' 'checkout-ui-extensions' 'checkout-ui-extensions-react' 'post-purchase-ui-extensions' 'post-purchase-ui-extensions-react' 'checkout-ui-extensions-run')
ROOT=$(pwd)

# Font color
Expand Down Expand Up @@ -38,7 +38,7 @@ function run_command {
if [[ -z $spin ]]; then
$command
else
ssh -o LogLevel=ERROR $projectDirectoryOrWorkspace $command
ssh -o LogLevel=ERROR `spin show | grep Shopify/$projectName | awk '{print $1}'` $command
fi
}

Expand Down Expand Up @@ -214,7 +214,7 @@ function build_consumer {

done

echo "💃 ${GREEN}Build copied to ${BOLD}$projectDirectory${NORMAL}.${NONE} Run the project to see your changes from UI Extensions packages."
echo "💃 ${GREEN}Build copied to ${BOLD}$projectDirectoryOrWorkspace${NORMAL}.${NONE} Run the project to see your changes from UI Extensions packages."

exit 0
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/restore-consumer-spin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
. "$PWD/scripts/consumer-helper.sh"

usage="
Usage: $(basename "$0") <workspace>
Usage: $(basename "$0") <workspace short name>
Restore a project by removing UI Extension packages and running \`yarn install\`
<workspace> Target spin workspace, i.e. \`web.test.trish-ta.us.spin.dev\`
<workspace short name> Target spin workspace short name, i.e. only enter \`web\` if your workspace is \`web.test.trish-ta.us.spin.dev\`
Options:
-h, --help Show this help text
Expand Down

0 comments on commit 6ffaedb

Please sign in to comment.