Created
April 7, 2014 05:24
-
-
Save andrewmartin/10015220 to your computer and use it in GitHub Desktop.
gruntfile open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open = require('open') | |
fs = require('fs') | |
module.exports = (grunt) -> | |
grunt.initConfig | |
openFiles: | |
options: | |
filename: "index.html" | |
appName: "Firefox" | |
path: "./" | |
grunt.registerMultiTask 'openFiles', 'open', -> | |
options = @options() | |
basePath = @data.toString() | |
files = fs.readdirSync(basePath) | |
for i of files | |
continue unless files.hasOwnProperty(i) | |
name = basePath + files[i] | |
if fs.statSync(name).isDirectory() | |
open(name + "/" + options.filename, options.appName) | |
grunt.registerTask("default", "openFiles") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment