This repository has been archived by the owner on Mar 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 135
/
Rakefile
57 lines (53 loc) · 1.51 KB
/
Rakefile
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
desc 'Build the standalone script'
task :build do
manifest = %w(
lib/ghi/commands/version.rb
lib/ghi.rb
lib/ghi/formatting/colors.rb
lib/ghi/formatting.rb
lib/ghi/authorization.rb
lib/ghi/client.rb
lib/ghi/editor.rb
lib/ghi/web.rb
lib/ghi/commands.rb
lib/ghi/commands/command.rb
lib/ghi/commands/assign.rb
lib/ghi/commands/close.rb
lib/ghi/commands/comment.rb
lib/ghi/commands/config.rb
lib/ghi/commands/edit.rb
lib/ghi/commands/disable.rb
lib/ghi/commands/enable.rb
lib/ghi/commands/help.rb
lib/ghi/commands/label.rb
lib/ghi/commands/list.rb
lib/ghi/commands/lock.rb
lib/ghi/commands/milestone.rb
lib/ghi/commands/open.rb
lib/ghi/commands/show.rb
lib/ghi/commands/status.rb
lib/ghi/commands/unlock.rb
bin/ghi
)
files = FileList[*manifest]
File.open 'ghi', 'w' do |f|
f.puts '#!/usr/bin/env ruby'
f.puts '# encoding: utf-8'
files.each { |file| f << File.read(file).gsub(/^\s+autoload.+$\n+/, '') }
f.chmod 0755
end
system './ghi 1>/dev/null'
puts "ghi succesfully built!"
end
desc 'Build the manuals'
task :man do
`ronn man/*.ronn --manual='GHI Manual' --organization='Stephen Celis'`
end
desc 'Install the standalone script'
task :install => [:build, :man] do
prefix = ENV['PREFIX'] || ENV['prefix'] || '/usr/local'
FileUtils.mkdir_p "#{prefix}/bin"
FileUtils.cp 'ghi', "#{prefix}/bin"
FileUtils.mkdir_p "#{prefix}/share/man/man1"
FileUtils.cp Dir["man/*.1"], "#{prefix}/share/man/man1"
end