-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhooks.rb
More file actions
executable file
·44 lines (35 loc) · 1.14 KB
/
hooks.rb
File metadata and controls
executable file
·44 lines (35 loc) · 1.14 KB
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
require 'package'
include Logging
add_guard :command => :install do |package|
not package.installed?
end
add_before_hook :command => :install do |package|
for dependency in package.class.dependency_names
Packages.install(dependency)
end
end
add_guard :command => :remove do |package|
package.installed?
end
add_before_hook :command => :install do |package|
package.process_support_files
end
add_after_hook :command => :remove do |package|
package.remove_directories
end
add_after_hook :command => :install do |package|
debug "#{package.name} installs_service? #{package.installs_service?}"
package.install_service if package.installs_service?
end
add_after_hook :command => :remove do |package|
debug "#{package.name} installs_service? #{package.installs_service?}"
package.remove_service if package.installs_service?
end
add_before_hook :command => :install do |package|
debug "#{package.name} has_repository? #{package.has_repository?}"
package.download_repository if package.has_repository?
end
add_before_hook :command => :install do |package|
debug "#{package.name} creating directories"
package.create_directories
end