Skip to content

Instantly share code, notes, and snippets.

@fpigerre
Last active December 20, 2016 05:35
Show Gist options
  • Save fpigerre/c9f4373d4dbccb6b131a331a2b0f8d3b to your computer and use it in GitHub Desktop.
Save fpigerre/c9f4373d4dbccb6b131a331a2b0f8d3b to your computer and use it in GitHub Desktop.
Configuration files that could be used to automate Semantic-UI installation for 2factorauth/twofactorauth.
var gulp = require('gulp');
var uncss = require('gulp-uncss');
var spawn = require('child_process').spawn;
var cleanCSS = require('gulp-clean-css');
gulp.task('default', function() {
console.log("### Please run 'gulp build', then 'gulp clean'.");
});
gulp.task('build', function() {
// Change working directory
process.chdir('semantic/');
// Gulp tasks that will be run.
var tasks = ['build'];
var child = spawn('gulp', tasks);
// Print output from Gulpfile
child.stdout.on('data', function(data) {
if (data) {
console.log(data.toString());
}
});
});
gulp.task('clean', function() {
gulp.src('semantic/dist/semantic.css')
.pipe(uncss({
html: ['_site/index.html', '_site/notes/**/*.html', '_site/providers/index.html']
}))
.pipe(gulp.dest('semantic/dist/out'));
return gulp.src('semantic/dist/out/semantic.css')
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(gulp.dest('lib/'));
});
{
"name": "twofactorauth",
"version": "1.0.0",
"description": "List of sites with two factor auth support",
"dependencies": {
"semantic-ui": "^2.2.6"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-clean-css": "^2.3.2",
"gulp-uglify": "^2.0.0",
"gulp-uncss": "^1.0.6"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/2factorauth/twofactorauth.git"
},
"keywords": [
"2fa",
"twofactorauth",
"security"
],
"author": "2factorauth",
"license": "MIT",
"bugs": {
"url": "https://github.com/2factorauth/twofactorauth/issues"
},
"homepage": "https://github.com/2factorauth/twofactorauth#readme"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment