vagrant-gitcredentials 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,7 @@ module VagrantPlugins
|
|
8
8
|
script.concat(["ssh-keygen -N '' -f ~/.ssh/github_rsa", "ssh-add ~/.ssh/github_rsa"])
|
9
9
|
script.concat(["set -- $(<~/.ssh/github_rsa.pub)", 'JSON=\'{"title":"vagrant provision key", "key": "ssh-rsa \'$2\'"}\''])
|
10
10
|
script.concat(['curl -u "$GITHUB_USERNAME:$GITHUB_PASSWORD" -d "$JSON" https://api.github.com/user/keys'])
|
11
|
+
@machine.communicate.execute("cat '' > ~/.ssh/github.sh")
|
11
12
|
# create script
|
12
13
|
script.each {
|
13
14
|
|l|
|
@@ -19,7 +20,7 @@ module VagrantPlugins
|
|
19
20
|
@machine.communicate.execute("cat ~/.ssh/github.sh")
|
20
21
|
# execute script w/ permissions
|
21
22
|
promptCredentials()
|
22
|
-
@machine.communicate.execute("sh ~/.ssh/github.sh
|
23
|
+
@machine.communicate.execute("sh ~/.ssh/github.sh '#@gitUsername' '#@gitPassword'")
|
23
24
|
|
24
25
|
@ui.info("created ssh key")
|
25
26
|
end
|
@@ -32,8 +33,8 @@ module VagrantPlugins
|
|
32
33
|
# get (temporarily) git credentials from user
|
33
34
|
def promptCredentials
|
34
35
|
@ui.info("We will now generate an ssh key and add it to your github account.")
|
35
|
-
@gitUsername = @ui.ask("What is your github account name? ")
|
36
|
-
@gitPassword = @ui.ask("What is your github account password? (not stored) ")
|
36
|
+
@gitUsername = Shellwords.escape(@ui.ask("What is your github account name? "))
|
37
|
+
@gitPassword = Shellwords.escape(@ui.ask("What is your github account password? (not stored) "))
|
37
38
|
end
|
38
39
|
end
|
39
40
|
end
|