Skip to content

Commit

Permalink
Merge pull request #19 from kballard/patch-1
Browse files Browse the repository at this point in the history
Update generated index.coffee to use fs.existsSync
  • Loading branch information
technicalpickles committed Dec 22, 2014
2 parents 665bde0 + bb3e9b0 commit 4a98e43
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions generators/script/templates/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ path = require 'path'

module.exports = (robot, scripts) ->
scriptsPath = path.resolve(__dirname, 'src')
fs.exists scriptsPath, (exists) ->
if exists
for script in fs.readdirSync(scriptsPath)
if scripts? and '*' not in scripts
robot.loadFile(scriptsPath, script) if script in scripts
else
robot.loadFile(scriptsPath, script)
if fs.existsSync scriptsPath
for script in fs.readdirSync(scriptsPath).sort()
if scripts? and '*' not in scripts
robot.loadFile(scriptsPath, script) if script in scripts
else
robot.loadFile(scriptsPath, script)

0 comments on commit 4a98e43

Please sign in to comment.