docman 0.0.60 → 0.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/application.rb +13 -3
- data/lib/docman/version.rb +1 -1
- metadata +1 -3
- data/bin/check-branch.sh +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7009223c674b7c9586daddfc4e26dfc83acbe8d5
|
4
|
+
data.tar.gz: 73fc9033d667cea02df6797f509807d6f05bdbad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02fa60e273348c2bb71bfbb05e4d67a5e00a1998781c47822bc89aabcb045352807da7735cf837f6ed551c68d83e1ca24bb5178e2ab2599dbd6f2637434d2385
|
7
|
+
data.tar.gz: e60b30a0ba2a0564302dfe2e35163ee2e6ee6e890ee68147a02ff603bb7003000bcf6ba53430738debf32dfbfd51fe8a0976325a8ca431a21045679289a91406
|
data/lib/application.rb
CHANGED
@@ -117,13 +117,23 @@ module Docman
|
|
117
117
|
log cmd
|
118
118
|
path = Dir.pwd
|
119
119
|
branch = 'commands'
|
120
|
-
|
121
|
-
|
120
|
+
current_branch = GitUtil.branch
|
121
|
+
GitUtil.exec("fetch")
|
122
|
+
have_branch = Exec.do("git ls-remote --exit-code . origin/#{branch} &> /dev/null")
|
123
|
+
log have_branch
|
124
|
+
if have_branch
|
125
|
+
GitUtil.exec("checkout #{branch}")
|
126
|
+
GitUtil.exec("pull origin #{branch}")
|
127
|
+
else
|
128
|
+
GitUtil.exec("checkout --orphan #{branch}")
|
129
|
+
GitUtil.exec("rm --cached -r .", false)
|
130
|
+
GitUtil.exec("clean -f -d", false)
|
131
|
+
end
|
122
132
|
File.open(File.join(path, 'commands'), 'a') {|f| f.puts cmd}
|
123
133
|
GitUtil.exec("add commands")
|
124
134
|
GitUtil.exec("commit -m 'Added command'")
|
125
135
|
GitUtil.push(path, branch, true)
|
126
|
-
GitUtil.exec("checkout #{
|
136
|
+
GitUtil.exec("checkout #{current_branch}")
|
127
137
|
end
|
128
138
|
end
|
129
139
|
|
data/lib/docman/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.61
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Tolstikov
|
@@ -141,7 +141,6 @@ email:
|
|
141
141
|
- atolstikov@adyax.com
|
142
142
|
executables:
|
143
143
|
- bump-version.sh
|
144
|
-
- check-branch.sh
|
145
144
|
- dm_repo_clean.sh
|
146
145
|
- docman
|
147
146
|
- docman.rb
|
@@ -156,7 +155,6 @@ files:
|
|
156
155
|
- README.md
|
157
156
|
- Rakefile
|
158
157
|
- bin/bump-version.sh
|
159
|
-
- bin/check-branch.sh
|
160
158
|
- bin/dm_repo_clean.sh
|
161
159
|
- bin/docman
|
162
160
|
- bin/docman.rb
|
data/bin/check-branch.sh
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
if [ -n "$1" ]; then
|
4
|
-
git fetch
|
5
|
-
BRANCH="$1"
|
6
|
-
git ls-remote --exit-code . origin/${BRANCH} &> /dev/null
|
7
|
-
if [ $? == 0 ]; then
|
8
|
-
git checkout ${BRANCH}
|
9
|
-
git pull origin ${BRANCH}
|
10
|
-
else
|
11
|
-
git checkout --orphan ${BRANCH}
|
12
|
-
git rm --cached -r .
|
13
|
-
git clean -f -d
|
14
|
-
fi
|
15
|
-
git push -u origin ${BRANCH}
|
16
|
-
fi
|