This repository has been archived by the owner on May 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
woody
executable file
·66 lines (56 loc) · 1.52 KB
/
woody
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#! /usr/bin/env ruby
require 'woody'
require 'commander/import'
program :name, 'woody'
program :version, Woody::VERSION
program :description, 'Podcast static site generator'
default_command :compile
$dir = "."
global_option '--dir', '--dir path/to/site', "Specifies path to Woody site directory, if not the current directory" do |dir|
$dir = dir
end
command :compile do |c|
c.description = "Compiles the site"
c.option "--no-add", "Don't ask to add new metadata"
c.action do |args, options|
site = Woody.new($dir)
site.compile(options)
end
end
alias_command :c, :compile
command :deploy do |c|
c.description = "Deploys the site"
c.action do |args, options|
site = Woody.new($dir)
site.deploy
end
end
alias_command :d, :deploy
command :cd do |c|
c.description = "Compiles then deploys the site"
c.option "--no-add", "Don't ask to add new metadata"
c.action do |args, options|
site = Woody.new($dir)
site.compile(options)
site.deploy
end
end
command :new do |c|
c.description = "Creates a blank Woody site with some defaults"
c.syntax = "new [sitename]"
c.action do |args, options|
if args[0].nil? or !(args[0].is_a? String)
puts "Syntax: woody new [sitename]"
exit!
end
Woody::Generator.new_site(args[0])
end
end
command :'update templates' do |c|
c.description = "Sets template files to current default. DESTRUCTIVE!"
c.action do |args, options|
site = Woody.new($dir)
site.update_templates
end
end
alias_command :'templates update', :'update templates'