git-semver-cop 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/git-semver-cop/generator.rb +12 -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: d2b9d994d7c3dc9f0605d651dec3f345295b6cc9
|
4
|
+
data.tar.gz: cc2900d13274be1c014a4139b341fe930664d8fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcd09cdd5b75770dd1d027d4c7ef64cc51a8be2feca5eaf5c0479501b596be0eb98fd32cae3c83dba56cb63f88bf7c78ee2c1c79291d041069ccbcc8a9fed162
|
7
|
+
data.tar.gz: 1be54368ad4d4814106d5ab62d9d9fa2e2a3645b57fb4dea58aa104d3c9279acfd95267986841450c013ac58b98ee935066de7b3b02f9ded98cd139366c92e27
|
@@ -10,7 +10,18 @@ module GitSemverCop
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.destination
|
13
|
-
|
13
|
+
# For submodules which have a .git file that points to the module
|
14
|
+
hooks_dir = "/hooks/pre-commit"
|
15
|
+
|
16
|
+
if File.file?(".git")
|
17
|
+
File.expand_path(submodule_git + hooks_dir, Dir.pwd)
|
18
|
+
else
|
19
|
+
File.expand_path(".git" + hooks_dir, Dir.pwd)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.submodule_git
|
24
|
+
File.read(".git").strip[/^(gitdir: )(.+)$/, 2]
|
14
25
|
end
|
15
26
|
|
16
27
|
desc "init", "Generates a pre-commit hook to ensure you update your .semver"
|