Skip to content

Instantly share code, notes, and snippets.

@aprea
Last active December 9, 2021 01:50
Show Gist options
  • Save aprea/45a7f3b3583ff65a658d303c2e5a6207 to your computer and use it in GitHub Desktop.
Save aprea/45a7f3b3583ff65a658d303c2e5a6207 to your computer and use it in GitHub Desktop.
#!/bin/sh
WCPAY_BRANCH=$1
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
echo "Getting WCPay $WCPAY_BRANCH branch"
mkdir $HOME/apps/$USER/temp \
&& cd $HOME/apps/$USER/temp \
&& git clone https://github.com/Automattic/woocommerce-payments --depth=1 -b "$WCPAY_BRANCH" \
&& cd woocommerce-payments \
&& nvm install \
&& nvm use \
&& echo "Building WCPay $WCPAY_BRANCH branch" \
&& npm ci \
&& npm run build \
&& cp -a release/woocommerce-payments $HOME/apps/$USER/public/wp-content/plugins \
&& rm -rf $HOME/apps/$USER/temp/woocommerce-payments \
&& cd $HOME/apps/$USER/public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment