sentia_git_hooks 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/sentia_git_hooks_install +22 -10
- data/lib/sentia_git_hooks/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20d305ec5d38f89f2e3139f309f4228e246bac73
|
4
|
+
data.tar.gz: 4ac8ff208cbef4fb0f19f11342771c14802b2c23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d35c57e1af17f7892152ee95b094971ae50d21ba16e7d64a4101302467e779acfa580a701acbd5d89a53f7b701db0bb63e3bf24592e33b5e2454bc09ad6d0be9
|
7
|
+
data.tar.gz: cf0bd9afe0580ba4406bf0705799d2cabc38a5a7074f496e0e98cf5a426bfd77adc0552793bac0561be39cd1357c2836420c3b7b8440f18ef3afc359cbd367c2
|
@@ -1,16 +1,28 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
2
|
+
scripts_dir = File.expand_path "../../lib/scripts/", __FILE__
|
3
|
+
hooks_dir = File.expand_path ".git/hooks", Dir.pwd
|
3
4
|
|
4
|
-
|
5
|
+
script_files = Dir.entries(scripts_dir)
|
6
|
+
script_files.delete(".")
|
7
|
+
script_files.delete("..")
|
5
8
|
|
6
|
-
puts "Issuing command: #{command}"
|
7
9
|
|
8
|
-
|
10
|
+
script_files.each do |file|
|
11
|
+
path_to_script = File.expand_path file, scripts_dir
|
12
|
+
path_to_hook = File.expand_path file, hooks_dir
|
13
|
+
command = "ln -s '#{path_to_script}' '#{path_to_hook}'"
|
9
14
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
15
|
+
puts "Issuing command: #{command}"
|
16
|
+
|
17
|
+
`#{command}`
|
18
|
+
if $?.exitstatus != 0
|
19
|
+
puts "Failed
|
20
|
+
If a hook file already exists then we refuse to clobber it,
|
21
|
+
you'll have to delete it manually, or have it call the functionality
|
22
|
+
in our hook."
|
23
|
+
exit 1
|
24
|
+
end
|
16
25
|
end
|
26
|
+
|
27
|
+
puts "Success"
|
28
|
+
exit 0
|