Skip to content

Instantly share code, notes, and snippets.

@ShinichiNishikawa
Last active June 6, 2016 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShinichiNishikawa/825a3ba68aa61a7a552a345185ac755e to your computer and use it in GitHub Desktop.
Save ShinichiNishikawa/825a3ba68aa61a7a552a345185ac755e to your computer and use it in GitHub Desktop.
Theme Init
#!/bin/sh -eu
# exit if wp-cli, wordmove or git is not installed.
type wp >/dev/null 2>&1 || { echo >&2 "wp-cli is not installed. Aborting."; exit 1; }
# Variables.
DIRNAME=${PWD##*/}
URL_LOCAL=$(cd ../../.. && echo "${PWD##*/}")
npm init --yes
npm install gulp --save-dev
npm install gulp-sass --save-dev
npm install gulp-autoprefixer --save-dev
npm install browser-sync --save-dev
npm install gulp-plumber --save-dev
npm install gulp-sourcemaps --save-dev
curl https://gist.githubusercontent.com/ShinichiNishikawa/7f72356d3edcb33addef/raw/39da698e15e0da725f9d0f47b72c575e889f7818/gulpfile.js > gulpfile.js
mkdir sass
touch sass/style.scss
sed -i -e "s/example.loc/${URL_LOCAL}/g" gulpfile.js
gulp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment