yorobot 0.2.1 → 0.2.2
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/yorobot/github/git.rb +14 -8
- data/lib/yorobot/version.rb +1 -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: 847505c5153a9538c83b411771c985f37af24244
|
4
|
+
data.tar.gz: 65de3568ced94876da73ec17b76399604437efb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a9345178932c3ac2d4901a240f88b95d75992d7e024efcf608fa5e535a598df40f42b83ade976bc760b0a1c2ed6c19e7931c92c67474ef3c6f0d7cc40538249
|
7
|
+
data.tar.gz: f92929a759988a35020c5ae225c74186f9b29bc3f7c04a9f4c3e01a403bf76f4475375a58341fd3264c6b5f4271ad4f60bbdae9ec026fe039642ff43c8445967
|
data/lib/yorobot/github/git.rb
CHANGED
@@ -23,26 +23,32 @@ class Setup < Step
|
|
23
23
|
##############
|
24
24
|
## setup ssh
|
25
25
|
|
26
|
-
ssh_key
|
26
|
+
ssh_key = ENV['SSH_KEY']
|
27
|
+
|
27
28
|
if ssh_key.nil?
|
28
29
|
STDERR.puts "!! ERROR - required SSH_KEY env(ironment) variable missing"
|
29
30
|
exit 1
|
30
31
|
end
|
31
|
-
|
32
|
-
|
32
|
+
|
33
|
+
ssh_path = File.expand_path( '~/.ssh' )
|
34
|
+
|
35
|
+
if File.exist?( "#{ssh_path}/id_rsa" )
|
36
|
+
STDERR.puts "!! ERROR - ssh key >#{ssh_path}/id_rsa< already exists"
|
33
37
|
exit 1
|
34
38
|
end
|
35
39
|
|
36
40
|
## make sure path exists
|
37
|
-
FileUtils.mkdir_p(
|
38
|
-
|
41
|
+
FileUtils.mkdir_p( ssh_path ) unless Dir.exist?( ssh_path )
|
42
|
+
puts "--> writing ssh key to >#{ssh_path}/id_rsa<..."
|
43
|
+
File.open( "#{ssh_path}/id_rsa", 'w:utf-8' ) do |f|
|
39
44
|
f.write( ssh_key )
|
40
45
|
end
|
41
46
|
## note: ssh key must be "private" only access by owner (otherwise) WILL NOT work
|
42
|
-
res = File.chmod( 0600,
|
43
|
-
puts res ## returns number of files processed; should be 1 - assert - why? why not?
|
47
|
+
## res = File.chmod( 0600, "#{ssh_path}/id_rsa" )
|
48
|
+
## puts res ## returns number of files processed; should be 1 - assert - why? why not?
|
49
|
+
Computer::Shell.run( %Q{chmod 600 #{ssh_path}/id_rsa} )
|
44
50
|
|
45
|
-
Computer::Shell.run( %Q{ls -la
|
51
|
+
Computer::Shell.run( %Q{ls -la #{ssh_path}} )
|
46
52
|
# ssh -vT git@github.com
|
47
53
|
|
48
54
|
|
data/lib/yorobot/version.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
module YorobotCore ## todo/check: rename GittiBase or GittiMeta or such - why? why not?
|
7
7
|
MAJOR = 0 ## todo: namespace inside version or something - why? why not??
|
8
8
|
MINOR = 2
|
9
|
-
PATCH =
|
9
|
+
PATCH = 2
|
10
10
|
VERSION = [MAJOR,MINOR,PATCH].join('.')
|
11
11
|
|
12
12
|
def self.version
|