docman 0.0.57 → 0.0.58
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/check-branch.sh +15 -0
- data/lib/application.rb +16 -0
- data/lib/docman/cli.rb +8 -0
- data/lib/docman/git_util.rb +9 -5
- data/lib/docman/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bdd883823f0e69f4f90e51057458cf324078dc4
|
4
|
+
data.tar.gz: 137c6f73fc77ce5a44a617361593202002664e0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92c3c175673d9b25e7d04b3a927b3ab204d82febd6cf07f6d5983e51de0a2561ee76ed65085336aa025ae7463fddda2cef9897a445a2593f142e0688e7788a84
|
7
|
+
data.tar.gz: 1a238ca622220d257bd8b8bb8ac39895b03854e403cca265b5f049ba076f99bb9d2cae6bfd4e7735aa9623cabd63498816f2dc38a62648f1b0317a408547a39f
|
data/bin/check-branch.sh
ADDED
@@ -0,0 +1,15 @@
|
|
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
|
+
fi
|
data/lib/application.rb
CHANGED
@@ -111,6 +111,22 @@ module Docman
|
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
114
|
+
def drush(env, site, command)
|
115
|
+
with_rescue(false) do
|
116
|
+
cmd = "drush env: '#{env}', site: '#{site}', '#{command}'"
|
117
|
+
log cmd
|
118
|
+
path = Dir.pwd
|
119
|
+
branch = 'commands'
|
120
|
+
currentBranch = GitUtil.branch
|
121
|
+
Exec.do "#{Application::bin}/check-branch.sh #{branch}"
|
122
|
+
File.open(File.join(path, 'commands'), 'w') {|f| f.write cmd}
|
123
|
+
GitUtil.exec("add commands")
|
124
|
+
GitUtil.exec("commit -m 'Added command'")
|
125
|
+
GitUtil.push(path, branch)
|
126
|
+
GitUtil.exec("checkout #{currentBranch}")
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
114
130
|
def write_state state
|
115
131
|
filepath = File.join(@workspace_dir, 'state')
|
116
132
|
File.open(filepath, 'w') { |file| file.write(state) }
|
data/lib/docman/cli.rb
CHANGED
@@ -86,6 +86,14 @@ module Docman
|
|
86
86
|
say('Complete!', :green)
|
87
87
|
end
|
88
88
|
|
89
|
+
desc 'drush', 'Execute remote drush commands'
|
90
|
+
def drush(drush_alias, command)
|
91
|
+
env = drush_alias.partition('.').first.partition('@').last
|
92
|
+
site = drush_alias.partition('.').last
|
93
|
+
Application.instance.drush(env, site, command)
|
94
|
+
say('Complete!', :green)
|
95
|
+
end
|
96
|
+
|
89
97
|
no_commands {
|
90
98
|
def current_dir_has_config_dir
|
91
99
|
File.directory?('config')
|
data/lib/docman/git_util.rb
CHANGED
@@ -82,9 +82,13 @@ module Docman
|
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
|
-
def self.pull(path)
|
85
|
+
def self.pull(path, options = nil)
|
86
86
|
Dir.chdir path
|
87
|
-
exec
|
87
|
+
exec "pull#{options}"
|
88
|
+
end
|
89
|
+
|
90
|
+
def self.branch()
|
91
|
+
exec "rev-parse --abbrev-ref HEAD", false
|
88
92
|
end
|
89
93
|
|
90
94
|
def self.repo?(path)
|
@@ -101,10 +105,10 @@ module Docman
|
|
101
105
|
result.delete!("\n")
|
102
106
|
end
|
103
107
|
|
104
|
-
def self.push(root_path, version)
|
108
|
+
def self.push(root_path, version, show_result = true)
|
105
109
|
Dir.chdir root_path
|
106
|
-
exec "pull origin #{version}"
|
107
|
-
exec "push origin #{version}"
|
110
|
+
exec "pull origin #{version}", show_result
|
111
|
+
exec "push origin #{version}", show_result
|
108
112
|
end
|
109
113
|
|
110
114
|
def self.tag(root_path, tag)
|
data/lib/docman/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.58
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Tolstikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -141,6 +141,7 @@ email:
|
|
141
141
|
- atolstikov@adyax.com
|
142
142
|
executables:
|
143
143
|
- bump-version.sh
|
144
|
+
- check-branch.sh
|
144
145
|
- dm_repo_clean.sh
|
145
146
|
- docman
|
146
147
|
- docman.rb
|
@@ -155,6 +156,7 @@ files:
|
|
155
156
|
- README.md
|
156
157
|
- Rakefile
|
157
158
|
- bin/bump-version.sh
|
159
|
+
- bin/check-branch.sh
|
158
160
|
- bin/dm_repo_clean.sh
|
159
161
|
- bin/docman
|
160
162
|
- bin/docman.rb
|