Skip to content

Commit

Permalink
chore(build): create dist folder if needed in 'gulp clean' task
Browse files Browse the repository at this point in the history
  • Loading branch information
limonte committed Apr 22, 2019
1 parent 3962be6 commit d5963b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const browserSync = require('browser-sync').create()
const packageJson = require('./package.json')
const execute = require('./utils/execute')
const log = require('fancy-log')
const fs = require('fs')
const version = process.env.VERSION || packageJson.version
const fsPromises = require('fs').promises

const banner = `/*!
* ${packageJson.name} v${version}
Expand All @@ -30,12 +30,16 @@ const skipStandalone = process.argv.includes('--skip-standalone')
// ---

gulp.task('clean', () => {
return fsPromises.readdir('dist')
if (!fs.existsSync('dist')) {
fs.mkdirSync('dist')
}

return fs.promises.readdir('dist')
.then(fileList => {
if (fileList.length > 0) {
let unlinkPromises = []
fileList.forEach(fileName => {
unlinkPromises.push(fsPromises.unlink(`dist/${fileName}`))
unlinkPromises.push(fs.promises.unlink(`dist/${fileName}`))
})
return Promise.all(unlinkPromises)
}
Expand Down
2 changes: 1 addition & 1 deletion src/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
$not-output: '';

@each $not in $ignor-list {
$not-output: $not-output + ':not(#{$not})'; /* stylelint-disable-line scss/no-duplicate-dollar-variables */
$not-output: $not-output + ':not(#{$not})'; // stylelint-disable-line scss/no-duplicate-dollar-variables
}

&#{$not-output} {
Expand Down

0 comments on commit d5963b8

Please sign in to comment.