forked from zanker/github-trello
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrello-web
executable file
·28 lines (24 loc) · 848 Bytes
/
trello-web
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env ruby
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + "/../lib")
require "vegas"
require "yaml"
require "github-trello/server"
Vegas::Runner.new(GithubTrello::Server, "trello-web", {
:launch_path => lambda {|vegas|
path = File.join(vegas.app_dir, "trello.yml")
if File.exists?(path)
puts "[OK] Using configuration file #{path}."
GithubTrello::Server.config = YAML::load(File.read(path))
else
puts "[WARNING] No configuration found at #{path}."
puts "We've generated an example one for you, but you need to configure it still."
root_dir = File.expand_path(File.dirname(__FILE__) + "/../")
sample_config_path = root_dir + "/sample_config.yml"
File.open(path, "w+") do |f|
f.write(File.read(sample_config_path))
end
exit
end
nil
}
})