Skip to content

Instantly share code, notes, and snippets.

@ukabu
Created February 20, 2014 14:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ukabu/9114366 to your computer and use it in GitHub Desktop.
Save ukabu/9114366 to your computer and use it in GitHub Desktop.
Graphviz dot to png using Gulp
var gulp = require('gulp')
var spawn = require('gulp-spawn')
gulp.task('dot', function() {
return gulp.src('*.dot')
.pipe(spawn({
cmd: 'dot'
, args: ['-Tpng']
, filename: function(base, ext) {
return base+'.png'
}
}))
.pipe(gulp.dest('.'))
})
gulp.task('watch', function() {
gulp.watch('*.dot', ['dot'])
})
gulp.task('default', ['dot'])
{
"name": "dot-graphs",
"version": "0.0.0",
"description": "Dot Graphs to PNG",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": "",
"author": "Ukabu",
"license": "ISC",
"devDependencies": {
"gulp": "^3.5.2",
"gulp-spawn": "^0.2.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment