You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
642 B
33 lines
642 B
var converter = require('./index.js');
|
|
var fs = require('fs');
|
|
module.exports = function(grunt) {
|
|
|
|
grunt.initConfig({
|
|
pkg: grunt.file.readJSON('package.json'),
|
|
watch: {
|
|
options: {
|
|
livereload: {
|
|
port: 35729
|
|
}
|
|
},
|
|
all: {
|
|
files: ['**/*.txt'],
|
|
tasks: ['convert-tabs-to-html']
|
|
}
|
|
}
|
|
});
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
grunt.registerTask('default', ['watch']);
|
|
grunt.registerTask('convert-tabs-to-html', function(){
|
|
var done = this.async();
|
|
converter('test.txt', function(result){
|
|
console.log(result);
|
|
fs.writeFile('result.html', result, function(){
|
|
done();
|
|
});
|
|
});
|
|
});
|
|
|
|
};
|