Skip to content

Commit

Permalink
modularise theme directory name using environment vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaffen committed Sep 25, 2018
1 parent 0f4c1b2 commit 9589b51
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"projectDir": "web/wp-content/themes/woodchippr/",
"projectDir": "web",
"bundles":[
"main.js"
],
Expand Down
2 changes: 1 addition & 1 deletion gulp/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ gulp.task("sass", function() {
.pipe(prefix(JSON.parse(process.env.AUTOPREFIX_ARGS)))
.pipe(gulpif(process.env.NODE_ENV !== "production", sourcemaps.write()))
.pipe(gulpif(process.env.NODE_ENV === "production", csso()))
.pipe(gulp.dest(config.projectDir + "css/"))
.pipe(gulp.dest(config.projectDir + process.env.WP_CONTENT_DIR + '/themes/' + process.env.THEME_NAME + '/' + "css/"))
.pipe(livereload())
.pipe(notify("updated"));
});
2 changes: 1 addition & 1 deletion gulp/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ gulp.task("scripts", function() {

return gulp.src(entryPoints, {base:base})
.pipe(webpackStream(options, webpack))
.pipe(gulp.dest(config.projectDir+"/js"))
.pipe(gulp.dest(config.projectDir + process.env.WP_CONTENT_DIR + '/themes/' + process.env.THEME_NAME + '/' + "/js"))
.pipe(livereload());
});
2 changes: 1 addition & 1 deletion gulp/svgstore.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ gulp.task("svgstore", function () {
parserOptions: { xmlMode: true }
}))
.pipe(rename("inline-svgsprite.twig"))
.pipe(gulp.dest(config.projectDir + "views/partials/"))
.pipe(gulp.dest(config.projectDir + process.env.WP_CONTENT_DIR + '/themes/' + process.env.THEME_NAME + '/' + "views/partials/"))
.pipe(notify("SVGs Exported"));
});
1 change: 1 addition & 0 deletions sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ SCSS_DIR=scss
NODE_ENV=production
AUTOPREFIX_ARGS='["last 2 version", "> 1%", "ie 9", "ie 8"]'
SVG_DIR=svg
THEME_NAME=woodchippr

# Disable gulp notifications
# DISABLE_NOTIFIER=true
Expand Down

0 comments on commit 9589b51

Please sign in to comment.