lzcode 0.0.8 → 0.1.0
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/lzcode/version.rb +1 -1
- data/lib/source/LZCodeGitLab.rb +3 -1
- data/lib/source/LZCodeInner.rb +3 -3
- data/lib/source/z_download.sh +15 -4
- data/lib/source/z_update.sh +8 -4
- metadata +2 -3
- data/.gitignore +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cad0d823eff7dcd5b8090f9a577316474d1034d
|
4
|
+
data.tar.gz: 1fa28f765a1e0f6c518e81b55600054d17f97d04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a56d6d7eeae0f900d809d90e755511f67a42a237181e1a1cc87f7e8e4380e9c5c78aec8b2717a521b7b36017c409cf7b6187d527b5c8dc53c74d605089a63df
|
7
|
+
data.tar.gz: c2031a03ed9e8bff3d0471ecc1ae7a4f86e28bf02ad30b1f6bafc0bb2add18d05ad239040c2075a65b52c6312ae0110b2d4d7dd5df63796b48467766e1c0cf6b
|
data/lib/lzcode/version.rb
CHANGED
data/lib/source/LZCodeGitLab.rb
CHANGED
@@ -8,7 +8,7 @@ $Private_Token = ''
|
|
8
8
|
|
9
9
|
$GitHTTP_Address = ''
|
10
10
|
|
11
|
-
UserPathFile = File.expand_path('~')+'/.
|
11
|
+
UserPathFile = File.expand_path('~')+'/.lz_user'
|
12
12
|
|
13
13
|
class LZCodeGitLab
|
14
14
|
|
@@ -159,6 +159,8 @@ class LZCodeGitLab
|
|
159
159
|
|
160
160
|
codeInfo = Hash.new
|
161
161
|
|
162
|
+
uri = "#{$GitHTTP_Address}/api/v4/projects?private_token=#{$Private_Token}&search=#{keyword}&per_page=100"
|
163
|
+
|
162
164
|
data = httpInner("Searching",uri)
|
163
165
|
|
164
166
|
info = Array.new
|
data/lib/source/LZCodeInner.rb
CHANGED
@@ -154,7 +154,7 @@ class LZCodeInner
|
|
154
154
|
sayBye()
|
155
155
|
else
|
156
156
|
puts 'Performing update...'
|
157
|
-
log = system("#{$ScriptPath}/
|
157
|
+
log = system("#{$ScriptPath}/z_update.sh #{path} #{ForkName}")
|
158
158
|
if log == true
|
159
159
|
puts 'Operation completed!'
|
160
160
|
else
|
@@ -173,7 +173,7 @@ class LZCodeInner
|
|
173
173
|
#Download
|
174
174
|
def run_s_download(path,addr,forkAddr)
|
175
175
|
puts 'Performing download...'
|
176
|
-
log = system("#{$ScriptPath}/
|
176
|
+
log = system("#{$ScriptPath}/z_download.sh #{path} #{addr} #{forkAddr} #{ForkName}")
|
177
177
|
if log == true
|
178
178
|
puts 'Operation completed!'
|
179
179
|
else
|
@@ -287,7 +287,7 @@ class LZCodeInner
|
|
287
287
|
sayBye()
|
288
288
|
else
|
289
289
|
puts 'Performing commit...'
|
290
|
-
log = system("#{$ScriptPath}/
|
290
|
+
log = system("#{$ScriptPath}/z_submit.sh #{$Keyword} #{$ForkName}")
|
291
291
|
if log == true
|
292
292
|
|
293
293
|
puts 'Operation completed!'
|
data/lib/source/z_download.sh
CHANGED
@@ -9,10 +9,11 @@ ForkName=$4
|
|
9
9
|
|
10
10
|
git clone $RemoteAddr
|
11
11
|
|
12
|
+
cd $Dir
|
13
|
+
|
12
14
|
if [[ $ForkName != "" ]]
|
13
15
|
then
|
14
|
-
|
15
|
-
|
16
|
+
|
16
17
|
echo "Performing add ${ForkName}:${ForkAddr}"
|
17
18
|
|
18
19
|
git remote add $ForkName $ForkAddr
|
@@ -23,5 +24,15 @@ then
|
|
23
24
|
|
24
25
|
git merge $ForkName/master
|
25
26
|
|
26
|
-
|
27
|
-
|
27
|
+
fi
|
28
|
+
|
29
|
+
current_branch=$(git branch | awk '$1 == "*"{print $2}')
|
30
|
+
|
31
|
+
read -r -p "New Branch Name[\"Enter\" is current branch:$current_branch]:" input
|
32
|
+
|
33
|
+
if [[ $input != "" ]]
|
34
|
+
then
|
35
|
+
git checkout -b $current_branch
|
36
|
+
fi
|
37
|
+
|
38
|
+
cd ..
|
data/lib/source/z_update.sh
CHANGED
@@ -39,13 +39,17 @@ else
|
|
39
39
|
git merge origin/master
|
40
40
|
fi
|
41
41
|
|
42
|
-
|
42
|
+
if [[ "$current_branch" != "master" ]]
|
43
|
+
then
|
44
|
+
|
45
|
+
echo "Switch ${current_branch} branch."
|
43
46
|
|
44
|
-
git checkout
|
47
|
+
git checkout $current_branch
|
45
48
|
|
46
|
-
echo "Update ${current_branch} branch."
|
49
|
+
echo "Update ${current_branch} branch."
|
47
50
|
|
48
|
-
git rebase master
|
51
|
+
git rebase master
|
52
|
+
fi
|
49
53
|
|
50
54
|
if [[ "$stash_result" == "" ]]
|
51
55
|
then
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lzcode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ningyuan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: An automatic tool of GitLab.
|
14
14
|
email:
|
@@ -20,7 +20,6 @@ executables:
|
|
20
20
|
extensions: []
|
21
21
|
extra_rdoc_files: []
|
22
22
|
files:
|
23
|
-
- ".gitignore"
|
24
23
|
- CODE_OF_CONDUCT.md
|
25
24
|
- Gemfile
|
26
25
|
- LICENSE.txt
|