itamae-plugin-recipe-anyenv 0.3.33 → 0.3.34
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/itamae/plugin/recipe/anyenv.rb +34 -54
- data/lib/itamae/plugin/recipe/anyenv/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: 72f3136b9b0d55e96537940c93d00ca18f84eb00
|
|
4
|
+
data.tar.gz: 5a86b04b609adc05c1e996c4bc0bcd37b8b26a5b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d71c4bc8f668e0dff04c55ac159aeacd47ca2efef50646866872a6e06765b5e78cb5792936c3a0762ba833b034e1f07bc5d0a6270154d5eee0b74eed3c672367
|
|
7
|
+
data.tar.gz: 8b7335785af908cc66791b58867a939dc1fc8713d8740e166529701f71783964291fa3c10ec9ea12b2b46b0460e4a123889c22cda5b13b029b08afd345dcd033
|
|
@@ -22,21 +22,9 @@ def scheme
|
|
|
22
22
|
@scheme ||= node[:anyenv][:scheme] || 'git'
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
def
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
install('anyenv', env)
|
|
29
|
-
|
|
30
|
-
vers.each { |ver| install(env, ver) }
|
|
31
|
-
|
|
32
|
-
global_version(env, vers.first)
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def install(from, to)
|
|
38
|
-
execute anyenv_init_with("yes | #{from} install #{to};")
|
|
39
|
-
end
|
|
25
|
+
# def install(from, to)
|
|
26
|
+
# execute anyenv_init_with("yes | #{from} install #{to};")
|
|
27
|
+
# end
|
|
40
28
|
|
|
41
29
|
def init(username)
|
|
42
30
|
@username = username
|
|
@@ -103,49 +91,41 @@ def clone_anyenv_update
|
|
|
103
91
|
clone_repository(install_path, repo_path)
|
|
104
92
|
end
|
|
105
93
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
94
|
+
def install_envs(attributes)
|
|
95
|
+
attributes[:install_versions].each do |envs|
|
|
96
|
+
envs.each do |env, vers|
|
|
97
|
+
install_env(env)
|
|
110
98
|
|
|
111
|
-
|
|
112
|
-
# install_env_version(env, ver)
|
|
113
|
-
# end
|
|
99
|
+
vers.each { |ver| install_env_version(env, ver) }
|
|
114
100
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
101
|
+
global_version(env, vers.first)
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
119
105
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
# end
|
|
106
|
+
def install_env(envname)
|
|
107
|
+
execute "install #{envname}" do
|
|
108
|
+
user @username if @username
|
|
109
|
+
command anyenv_init_with "yes | anyenv install #{envname};"
|
|
110
|
+
not_if anyenv_init_with "type #{envname}"
|
|
111
|
+
end
|
|
112
|
+
end
|
|
128
113
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
114
|
+
def install_env_version(envname, version)
|
|
115
|
+
execute "#{envname} install #{version}" do
|
|
116
|
+
user @username if @username
|
|
117
|
+
command anyenv_init_with "yes | #{envname} install #{version}"
|
|
118
|
+
not_if anyenv_init_with "#{envname} versions | grep #{version}"
|
|
119
|
+
end
|
|
120
|
+
end
|
|
136
121
|
|
|
137
122
|
def global_version(envname, version)
|
|
138
|
-
execute
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
# #{envname} global #{version};
|
|
147
|
-
# #{envname} rehash;
|
|
148
|
-
# EOS
|
|
149
|
-
# not_if "#{envname} global | grep #{version}"
|
|
150
|
-
# end
|
|
123
|
+
execute "#{envname} global #{version}" do
|
|
124
|
+
user @username if @username
|
|
125
|
+
command anyenv_init_with <<-EOS
|
|
126
|
+
#{envname} global;
|
|
127
|
+
#{version}; #{envname} rehash;
|
|
128
|
+
EOS
|
|
129
|
+
not_if anyenv_init_with "#{envname} global | grep #{version}"
|
|
130
|
+
end
|
|
151
131
|
end
|