Skip to content
This repository was archived by the owner on Sep 15, 2023. It is now read-only.

Commit 6a29c48

Browse files
maouehbenjtinsley
authored andcommitted
Fixed process.cwd() changes and reverted previous fixes
Changing from `--gulpfile node_modules/blendid/gulpfile.js` to `--gulpfile node_modules/blendid/gulpfile.js/index.js` had the unintended consequence of making the `process.cwd()` not the same being one directory lower than before. As such, a workaround fix was performed in 19e4825 & 538c85c to make blendid assets now relative one level lower also. This was not a proper fix and instead, the `bin/blendid` script has been updated to use one level lower by pointing to the previous directory directly instead of pointing to the main file of the directory. Previous modifications of previous workaround were reverted. As part of testing, fixed a bunch of small globbing problem with Gulp like .gitkeep files not copied or some other files not ignored correctly.
1 parent 6809dd4 commit 6a29c48

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

bin/blendid.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
const path = require('path')
33

44
const additionalArgs = require('minimist')(process.argv.slice(2))._
5-
const blendidEntryFile = path.resolve(__dirname, '../gulpfile.js/index.js')
5+
const blendidEntryDir = path.resolve(__dirname, '../gulpfile.js')
66
const gulpModulePath = path.dirname(require.resolve('gulp'))
77
const gulpBinaryFile = path.join(gulpModulePath, '/bin/gulp')
88

9-
let args = ['--gulpfile', blendidEntryFile]
9+
let args = ['--gulpfile', blendidEntryDir]
1010

1111
if(additionalArgs.length) {
1212
args = args.concat(additionalArgs)

gulpfile.js/tasks/http2-upgrade.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ gulp.task('http2-upgrade', function() {
1010
del([projectPath(PATH_CONFIG.src, PATH_CONFIG.stylesheets.src)], { force: true })
1111
log(colors.green('Cleaned stylesheets directory'))
1212

13-
const configStream = gulp.src('../extras/http2/**/*')
13+
const configStream = gulp.src('extras/http2/**/*')
1414
.pipe(gulp.dest(projectPath()))
1515

16-
const srcStream = gulp.src(['../src/stylesheets', '../src/javascripts', '../src/html'])
16+
const srcStream = gulp.src(['src/stylesheets', 'src/javascripts', 'src/html'])
1717
.pipe(gulp.dest(projectPath(PATH_CONFIG.src)))
1818

1919
log(colors.green('Created HTTP/2 ready stylesheets directory'))

gulpfile.js/tasks/init-config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ var colors = require('ansi-colors')
44
var projectPath = require('../lib/projectPath')
55
var merge = require('merge-stream')
66

7-
gulp.task('init-config', function() {
8-
var configStream = gulp.src(['./path-config.json', './task-config.js'])
7+
gulp.task('init-config', function () {
8+
var configStream = gulp.src(['gulpfile.js/path-config.json', 'gulpfile.js/task-config.js'])
99
.pipe(gulp.dest(projectPath('config')))
1010

1111
log(colors.green('Adding default path-config.json and task-config.js files to ./config/'))

gulpfile.js/tasks/init-craft.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ const mergeStream = require('merge-stream')
55
const projectPath = require('../lib/projectPath')
66

77
gulp.task('init-craft', function() {
8-
const configStream = gulp.src(['../extras/craft/**/*', '*!ASSET-README.md'])
8+
const configStream = gulp.src(['extras/craft/**/*', '!**/ASSETS-README.md'])
99
.pipe(gulp.dest(projectPath()))
1010

11-
const srcStream = gulp.src(['../src/**/*', '*.gitkeep', '!../src/html{,/**}', '!../src/static{,/**}'])
11+
const srcStream = gulp.src(['src/**/*', 'src/**/.gitkeep', '!src/html{,/**}', '!src/static{,/**}'])
1212
.pipe(gulp.dest(projectPath(PATH_CONFIG.src)))
1313

1414

gulpfile.js/tasks/init-drupal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ const projectPath = require('../lib/projectPath')
1010
gulp.task('init-drupal', function() {
1111
const envBasename = path.basename(process.env.INIT_CWD)
1212

13-
const configStream = gulp.src(['../extras/drupal/**/*', '!../extras/drupal/src/', '!../extras/drupal/src/**/*', '!**/README.md'])
13+
const configStream = gulp.src(['extras/drupal/**/*', '!extras/drupal/src/', '!extras/drupal/src/**/*', '!**/README.md'])
1414
.pipe(rename(function (filepath) {
1515
filepath.basename = filepath.basename.replace('THEMENAME', envBasename);
1616
}))
1717
.pipe(replace('THEMENAME', envBasename))
1818
.pipe(gulp.dest(projectPath()))
1919

20-
const srcStream = gulp.src(['../extras/drupal/src/**/*', '*.gitkeep'])
20+
const srcStream = gulp.src(['extras/drupal/src/**/*', 'extras/drupal/src/**/.gitkeep'])
2121
.pipe(gulp.dest(projectPath(PATH_CONFIG.src)))
2222

2323
log(colors.green('Created config/path-config.json'))

gulpfile.js/tasks/init-rails.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var colors = require('ansi-colors')
44
var projectPath = require('../lib/projectPath')
55

66
gulp.task('init-rails', function() {
7-
var stream = gulp.src(['../extras/rails/**/*', '*!README.md'])
7+
var stream = gulp.src(['extras/rails/**/*', 'extras/rails/**/.gitkeep', '!**/ASSETS-README.md'])
88
.pipe(gulp.dest(projectPath()))
99

1010
log(colors.green('Created app/helpers/blendid_asset_helper.rb'))

gulpfile.js/tasks/init.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ var projectPath = require('../lib/projectPath')
55
var merge = require('merge-stream')
66

77
gulp.task('init', function() {
8-
var defaultStream = gulp.src(['../extras/default/**/*'])
8+
var defaultStream = gulp.src(['extras/default/**/*', 'extras/default/**/.*'])
99
.pipe(gulp.dest(projectPath()))
1010

11-
var configStream = gulp.src(['./path-config.json', './task-config.js'])
11+
var configStream = gulp.src(['gulpfile.js/path-config.json', 'gulpfile.js/task-config.js'])
1212
.pipe(gulp.dest(projectPath('config')))
1313

14-
var srcStream = gulp.src(['../src/**/*', '*.gitkeep'])
14+
var srcStream = gulp.src(['src/**/*', 'src/**/.gitkeep'])
1515
.pipe(gulp.dest(projectPath(PATH_CONFIG.src)))
1616

1717
log(colors.green('Generating default Blendid project files'))

0 commit comments

Comments
 (0)