Skip to content

Commit

Permalink
fix(robot): Default path and loading bugs resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
timkinnane committed Dec 6, 2017
1 parent eb14d7b commit 2af9b27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion argv.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const getArgv = (robot) => yargs
alias: ['require', 'r'],
type: 'array',
describe: 'Alternative scripts paths\n',
default: []
default: 'scripts'
})
.config()
.alias('config', 'c')
Expand Down
4 changes: 2 additions & 2 deletions src/robot.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,10 @@ class Robot {

// Load scripts from a specified path, relative to app root
loadScripts (scriptsPath = 'scripts') {
scriptsPath = rootPath.resolve(scriptsPath)
this.logger.debug(`Loading scripts from ${scriptsPath}`)
if (!Array.isArray(scriptsPath)) scriptsPath = [scriptsPath]
scriptsPath.forEach((scriptsPath) => {
scriptsPath = rootPath.resolve(scriptsPath)
this.logger.debug(`Loading scripts from ${scriptsPath}`)
if (scriptsPath[0] === '/') return this.load(scriptsPath)
this.load(rootPath.resolve(scriptsPath))
})
Expand Down

0 comments on commit 2af9b27

Please sign in to comment.