LoginSignup
2
3

More than 5 years have passed since last update.

yo ( generator-hubot ) なしに 1 分で Hubot をはじめられるシェルスクリプト

Last updated at Posted at 2015-07-11

課題

yo や generator-hubot をうまく動かせない人が居る。

解決策

generator-hubot なしで Hubot をはじめられる環境を提供する。

例1: シェルスクリプト

前提: Node.js がインストールされていること。

以下のスクリプトの変数を適当に変更して実行すると良い。

例の通りに実行すると myhubot> @myhubot ping とすれば PONG が返ってくる。

#!/bin/sh

author='bouzuya <m@bouzuya.net>' # package.json の author
user_name='bouzuya'              # github の username
bot_name='myhubot'               # BOT 名

mkdir $bot_name
cd $bot_name

cat <<EOS >package.json
{ 
  "name": "$bot_name",
  "description": "$bot_name",
  "version": "1.0.0",
  "author": "$author",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/$user_name/$bot_name"
  },
  "scripts": {
    "start": "hubot -a shell -n $bot_name"
  }
}
EOS

cat <<EOS >external-scripts.json
[
  "hubot-diagnostics"
]
EOS

npm install --save coffee-script hubot hubot-diagnostics
npm start

残課題

次へのステップが示されていない。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3