docman 0.0.60 → 0.0.61

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12ccb5c7f248c0ccd33a8690ee0fb519f0ffbc76
4
- data.tar.gz: 0f1eb379c6d0b5021927f0641e1d24c8e2f03afd
3
+ metadata.gz: 7009223c674b7c9586daddfc4e26dfc83acbe8d5
4
+ data.tar.gz: 73fc9033d667cea02df6797f509807d6f05bdbad
5
5
  SHA512:
6
- metadata.gz: 0594b39d8fece6de40b68137c249857b35327dd1fe7c7b3fadee7722cd5689a3cc2267edfaf7f85ddc66a8b18b76034d5a68c985beaf990b8b6e7bd50e80328c
7
- data.tar.gz: ce420265f490e7c08e0a4e7a149331e72705e92d540a2c1699a0b13f159548b1f9e9079d33dc4de14b5ed65df287c470314ca42877818da4af4f6d684d5ef68b
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
- currentBranch = GitUtil.branch
121
- Exec.do "#{Application::bin}/check-branch.sh #{branch}"
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 #{currentBranch}")
136
+ GitUtil.exec("checkout #{current_branch}")
127
137
  end
128
138
  end
129
139
 
@@ -1,3 +1,3 @@
1
1
  module Docman
2
- VERSION = "0.0.60"
2
+ VERSION = "0.0.61"
3
3
  end
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.60
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