Path: blob/master/node_modules/@javascript-obfuscator/estraverse/gulpfile.js
1126 views
/*1Copyright (C) 2014 Yusuke Suzuki <[email protected]>23Redistribution and use in source and binary forms, with or without4modification, are permitted provided that the following conditions are met:56* Redistributions of source code must retain the above copyright7notice, this list of conditions and the following disclaimer.8* Redistributions in binary form must reproduce the above copyright9notice, this list of conditions and the following disclaimer in the10documentation and/or other materials provided with the distribution.1112THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'13AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE14IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE15ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY16DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES17(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;18LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND19ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT20(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF21THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.22*/2324'use strict';2526var gulp = require('gulp'),27git = require('gulp-git'),28bump = require('gulp-bump'),29filter = require('gulp-filter'),30tagVersion = require('gulp-tag-version');3132var TEST = [ 'test/*.js' ];33var POWERED = [ 'powered-test/*.js' ];34var SOURCE = [ 'src/**/*.js' ];3536/**37* Bumping version number and tagging the repository with it.38* Please read http://semver.org/39*40* You can use the commands41*42* gulp patch # makes v0.1.0 -> v0.1.143* gulp feature # makes v0.1.1 -> v0.2.044* gulp release # makes v0.2.1 -> v1.0.045*46* To bump the version numbers accordingly after you did a patch,47* introduced a feature or made a backwards-incompatible release.48*/4950function inc(importance) {51// get all the files to bump version in52return gulp.src(['./package.json'])53// bump the version number in those files54.pipe(bump({type: importance}))55// save it back to filesystem56.pipe(gulp.dest('./'))57// commit the changed version number58.pipe(git.commit('Bumps package version'))59// read only one file to get the version number60.pipe(filter('package.json'))61// **tag it in the repository**62.pipe(tagVersion({63prefix: ''64}));65}6667gulp.task('patch', [ ], function () { return inc('patch'); })68gulp.task('minor', [ ], function () { return inc('minor'); })69gulp.task('major', [ ], function () { return inc('major'); })707172