1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-06-28 00:27:58 +02:00

remove gulp-util

This commit is contained in:
Matthias Kretschmann 2017-05-28 05:09:32 +02:00
parent 29a4c41495
commit d7e97d16c7
Signed by: m
GPG Key ID: BD3C1F3EDD7831FC
3 changed files with 21 additions and 18 deletions

View File

@ -13,7 +13,6 @@ Requirements
You need to have the following tools installed on your development machine before moving on:
- [node.js](http://nodejs.org/) & [npm](https://npmjs.org/)
- [Bower](http://bower.io/)
- [Ruby](https://www.ruby-lang.org) (for sanity, install with [rvm](https://rvm.io/)) and [Bundler](http://bundler.io/)

View File

@ -11,6 +11,8 @@ import critical from 'critical'
import request from 'request'
import fs from 'fs'
import yaml from 'js-yaml'
import chalk from 'chalk'
import yargs from 'yargs'
// get all the configs: `pkg` and `site`
import pkg from './package.json'
@ -21,26 +23,28 @@ const $ = plugins()
// handle errors
const onError = (error) => {
$.util.log('')
$.util.log($.util.colors.red('You fucked up:', error.message, 'on line' , error.lineNumber))
$.util.log('')
console.log('')
console.log(chalk.red('You fucked up:', error.message, 'on line' , error.lineNumber))
console.log('')
this.emit('end')
}
// 'development' is just default, production overrides are triggered
// by adding the production flag to the gulp command e.g. `gulp build --production`
const isProduction = ($.util.env.production === true ? true : false)
const argv = yargs.parse(process.argv.slice(1))
const isProduction = argv.production
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// Terminal Banner
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
console.log("")
console.log($.util.colors.gray(" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>"))
console.log(chalk.dim(" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>"))
console.log("")
console.log($.util.colors.cyan(" (o) Just what do you think you're doing,", process.env.USER, "? "))
console.log(chalk.cyan(" (o) Just what do you think you're doing,", process.env.USER, "? "))
console.log("")
console.log($.util.colors.gray(" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>"))
console.log(chalk.dim(" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>"))
console.log("")
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -304,12 +308,12 @@ export const seo = (done) => {
const response = (error, response) => {
if (error) {
$.util.log($.util.colors.red(error))
console.log(chalk.red(error))
} else {
$.util.log($.util.colors.gray('Status:', response && response.statusCode))
console.log(chalk.dim('Status:', response && response.statusCode))
if (response.statusCode === 200) {
$.util.log($.util.colors.green('Successfully notified'))
console.log(chalk.green('Successfully notified'))
}
}
}
@ -351,9 +355,9 @@ export const watchSrc = () => {
// Build banner
//
export const buildBanner = (done) => {
console.log($.util.colors.gray(" ------------------------------------------"))
console.log($.util.colors.green(' Building ' + ($.util.env.production ? 'production' : 'dev') + ' version...'))
console.log($.util.colors.gray(" ------------------------------------------"))
console.log(chalk.dim(" ------------------------------------------"))
console.log(chalk.green(' Building ' + (isProduction ? 'production' : 'dev') + ' version...'))
console.log(chalk.dim(" ------------------------------------------"))
done()
}

View File

@ -34,6 +34,7 @@
"babel-core": ">=6.24.0",
"babel-preset-es2015": ">=6.24.0",
"browser-sync": ">=2.10.0",
"chalk": ">=1.1.3",
"concurrent-transform": ">=1.0.0",
"critical": ">=0.8.4",
"cssnano": ">=3.6.2",
@ -43,7 +44,6 @@
"gulp-awspublish": ">=2.0.2",
"gulp-awspublish-router": ">=0.1.1",
"gulp-cli": ">=1.2.2",
"gulp-filter": ">=2.0.2",
"gulp-header": ">=1.2.2",
"gulp-htmlmin": ">=1.1.2",
"gulp-if": ">=1.2.5",
@ -59,12 +59,12 @@
"gulp-stylus": ">=2.3.1",
"gulp-svg-sprite": ">=1.2.2",
"gulp-uglify": ">=1.2.0",
"gulp-util": ">=3.0.6",
"js-yaml": ">=3.8.3",
"request": ">=2.81.0"
"request": ">=2.81.0",
"yargs": ">=8.0.1"
},
"engines": {
"node": ">=5.0.0"
"node": ">=7.0.0"
},
"repository": {
"type": "git",