Skip to content

Commit 025a7c5

Browse files
committed
formated files in task/
1 parent 500f6f5 commit 025a7c5

File tree

3 files changed

+25
-23
lines changed

3 files changed

+25
-23
lines changed

tasks/build-preview.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function loadSampleUiModel (siteSrc) {
4949
).then((contents) => yaml.load(contents))
5050
}
5151

52-
function registerPartials (src) {
52+
function registerPartials(src) {
5353
return new Promise((resolve, reject) => {
5454
gulp
5555
.src('partials/*.hbs', { base: src, cwd: src })
@@ -64,7 +64,7 @@ function registerPartials (src) {
6464
})
6565
}
6666

67-
function registerHelpers (src) {
67+
function registerHelpers(src) {
6868
return new Promise((resolve, reject) => {
6969
gulp
7070
.src('helpers/*.js', { base: src, cwd: src })
@@ -80,7 +80,7 @@ function registerHelpers (src) {
8080
})
8181
}
8282

83-
function compileLayouts (src) {
83+
function compileLayouts(src) {
8484
const layouts = {}
8585
return new Promise((resolve, reject) => {
8686
gulp

tasks/build.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const gulp = require('gulp')
1010
const log = require('fancy-log')
1111
const map = require('map-stream')
1212
const mkdirp = require('mkdirp')
13-
const ordered = require('ordered-read-streams');
13+
const ordered = require('ordered-read-streams')
1414
const path = require('path')
1515
const postcss = require('gulp-postcss')
1616
const postcssCalc = require('postcss-calc')
@@ -64,7 +64,7 @@ module.exports = (src, dest) => {
6464
gulp
6565
.src('js/vendor/*.js', Object.assign({ read: false }, opts))
6666
.pipe(
67-
// see https://gulpjs.org/recipes/browserify-multiple-destination.html
67+
// see https://gulpjs.org/recipes/browserify-multiple-destination.html
6868
map((file, next) => {
6969
file.contents = browserify(file.relative, {
7070
basedir: src,
@@ -90,11 +90,11 @@ module.exports = (src, dest) => {
9090
])
9191

9292
m.pipe(gulp.dest(dest))
93-
.on('end', function() {
93+
.on('end', function () {
9494
log('Built sources written to:', `${dest}`)
9595
resolve()
9696
})
97-
.on('error', function(err) {
97+
.on('error', function (err) {
9898
log('Build error:', err)
9999
reject(err)
100100
})

tasks/pack.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,22 @@ const log = require('fancy-log')
66
const zip = require('gulp-zip').default
77

88
// pack all files and folders to a zip
9-
module.exports = (src, dest, bundleName) => new Promise((resolve, reject) => {
10-
if (!fs.existsSync(src)) {
11-
log('No sources found to pack, did the bundle task run successfully?')
12-
}
9+
module.exports = (src, dest, bundleName) =>
10+
new Promise((resolve, reject) => {
11+
if (!fs.existsSync(src)) {
12+
log('No sources found to pack, did the bundle task run successfully?')
13+
}
1314

14-
gulp
15-
.src('**/*', { base: src, cwd: src })
16-
.pipe(zip(`${bundleName}-bundle.zip`))
17-
.pipe(gulp.dest(dest)).on('end', function() {
18-
log('ZIP bundle created at:', `${dest}/${bundleName}-bundle.zip`)
19-
resolve()
20-
})
21-
.on('error', function(err) {
22-
console.error('Pack error:', err)
23-
reject(err)
24-
})
25-
})
15+
gulp
16+
.src('**/*', { base: src, cwd: src })
17+
.pipe(zip(`${bundleName}-bundle.zip`))
18+
.pipe(gulp.dest(dest))
19+
.on('end', function () {
20+
log('ZIP bundle created at:', `${dest}/${bundleName}-bundle.zip`)
21+
resolve()
22+
})
23+
.on('error', function (err) {
24+
console.error('Pack error:', err)
25+
reject(err)
26+
})
27+
})

0 commit comments

Comments
 (0)