Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Option to specify extra scripts dirs #355

merged 1 commit into from

4 participants



I added an option to specify extra scripts dirs to load. It's useful for us because we have a lot of scripts that are specific to our company and reside in our git repo. It would be nice to run Hubot and just point it at this dir, that way we can upgrade Hubot versions easily without having to copy over all our scripts, etc.



@cjbottaro this is great.

I just did something similar to include a single directory with --include ecarter/hubot@0405ffa before finding your pull request.

Definitely like your approach better since it allows for multiple directories.

:metal: gracias!

@tombell tombell merged commit d2a44bb into github:master

Changed the long form to --require as it better matched the -r.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 10, 2012
  1. @cjbottaro
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 0 deletions.
  1. +12 −0 bin/hubot
12 bin/hubot
@@ -22,6 +22,7 @@ Switches = [
[ "-h", "--help", "Display the help information" ],
[ "-l", "--alias ALIAS", "Enable replacing the robot's name with alias" ],
[ "-n", "--name NAME", "The name of the robot in chat" ],
+ [ "-r", "--scripts PATH", "Alternative scripts path" ],
[ "-s", "--enable-slash", "Enable replacing the robot's name with '/' (deprecated)" ],
[ "-v", "--version", "Displays the version of hubot installed" ]
@@ -31,6 +32,7 @@ Options =
alias: false
create: false
enableHttpd: true
+ scripts: []
name: "Hubot"
path: "."
@@ -57,6 +59,9 @@ Parser.on "alias", (opt, value) ->
Parser.on "name", (opt, value) -> = value
+Parser.on "scripts", (opt, value) ->
+ Options.scripts.push(value)
Parser.on "enable-slash", (opt) ->
console.log "WARNING: -s and --enable-slash are deprecated please use -l or --alias '/'"
Options.alias = '/'
@@ -101,6 +106,13 @@ else
scriptsPath = Path.resolve "node_modules", "hubot-scripts", "src", "scripts"
robot.loadHubotScripts scriptsPath, scripts
+ for path in Options.scripts
+ if path[0] == '/'
+ scriptsPath = path
+ else
+ scriptsPath = Path.resolve ".", path
+ robot.load scriptsPath
robot.adapter.on 'connected', loadScripts
Something went wrong with that request. Please try again.