Skip to content

Instantly share code, notes, and snippets.

@oskosk
Last active November 16, 2018 22:17
Show Gist options
  • Save oskosk/0b7c45522c945a62309dd57103f94133 to your computer and use it in GitHub Desktop.
Save oskosk/0b7c45522c945a62309dd57103f94133 to your computer and use it in GitHub Desktop.
Script for downloading and building Gutenberg on a Jurassic Ninja site
#!/bin/sh
GUTENBERG_BRANCH=master
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/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
nvm install 10
echo "Getting Gutenberg master branch"
cd $HOME/apps/$USER/public/wp-content/plugins \
&& git clone https://github.com/wordpress/gutenberg --depth=1 -b "$GUTENBERG_BRANCH" \
&& cd gutenberg \
&& echo "Building Gutenberg branch $GUTENBERG_BRANCH" \
&& npm ci \
&& npm run build \
&& rm -rf node_modules \
&& rm -rf $HOME/.npm \
&& rm -rf $HOME/.nvm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment