Skip to content

Commit 978e5e0

Browse files
author
Shuwen Qian
committed
Fix path issues
1 parent 100f2dd commit 978e5e0

6 files changed

Lines changed: 10 additions & 7 deletions

File tree

Gulpfile.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ var j = path.join;
88

99
//gulp plugins
1010
var plugins = require('gulp-load-plugins')({
11+
camelize: true,
12+
lazy: true,
1113
rename: {
1214
'gulp-util': 'gutil',
1315
'gulp-if': 'gif',

gulp/env.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
'use strict';
33

44
module.exports = {
5-
SRC:'src/',
5+
ROOT: '.',
6+
SRC: 'src/',
67
BUILD: 'build/',
78
BUILD_DOCS: 'build_docs/',
89
DOCS: 'docs/',

gulp/tasks/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
gulp.task('patch-lib', function() {
2929

30-
gulp.src(C.PATCH_LIST, {base: j(__dirname, C.BOWER)})
30+
gulp.src(C.PATCH_LIST, {base: C.BOWER})
3131
.pipe(dbg('patch-lib'))
3232
.pipe(plugins.wrap(function(data) {
3333
if (data.file.contents.toString('utf8').indexOf('/*patched*/') !== -1) {
@@ -36,7 +36,7 @@
3636
return "/*patched*/\n(function(define, require) { {{{contents}}} })();";
3737
}
3838
},{},{engine:'hogan'}).on('error',console.error))
39-
.pipe(gulp.dest( j(__dirname, C.BOWER) ));
39+
.pipe(gulp.dest(C.BOWER));
4040
});
4141

4242
gulp.task('clean', function() {

gulp/tasks/docs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
articleList: articles,
153153
articleMap: articleMap
154154
};
155-
var templatePath = j(__dirname, C.DOCS,'/article_template.html');
155+
var templatePath = j(C.DOCS,'/article_template.html');
156156
var templateString = fs.readFileSync(templatePath).toString('utf8');
157157
var template = hogan.compile(templateString);
158158
var doc = template.render(articleDoc, partialMap);
@@ -236,7 +236,7 @@
236236
.pipe(dbg('docs-modules'))
237237
.pipe(through.obj(function(file, enc, cb) {
238238
var moduleDoc = JSON.parse(file.contents);
239-
var templatePath = j(__dirname,C.DOCS,'/component_template.html');
239+
var templatePath = j(C.DOCS,'/component_template.html');
240240
var templateString = fs.readFileSync(templatePath, 'utf8');
241241
var template = hogan.compile(templateString);
242242
var doc = template.render(moduleDoc, partialMap);

gulp/tasks/live.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
var modules = glob.sync(j(C.MODULE_MASK,"/index.html"), {cwd:C.SRC});
4040
var moduleList = modules.map(function(name) { return name.replace('/index.html',''); });
4141
var moduleMap = {modules: moduleList};
42-
var templatePath = j(__dirname, C.TEMPLATES, '/index_template.html');
42+
var templatePath = j(C.TEMPLATES, '/index_template.html');
4343
var templateString = fs.readFileSync(templatePath, 'utf8');
4444
var template = hogan.compile(templateString);
4545
var index = template.render(moduleMap);

gulp/tasks/release.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
if(!version) version = 'patch';
3434
return gulp.src(['package.json', 'bower.json'])
3535
.pipe(plugins.bump({type: version}))
36-
.pipe(gulp.dest(__dirname));
36+
.pipe(gulp.dest(C.ROOT));
3737
}
3838

3939
gulp.task('release', function() {

0 commit comments

Comments
 (0)