itamae-plugin-recipe-anyenv 0.3.38 → 0.3.39
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 +54 -43
- 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: bdf92242740d8c8ea6fa9008989491ef97ed240c
|
4
|
+
data.tar.gz: eea7e6b2445e57d87a96a57ab5f36d070612730f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38213b85eda3af495227a86e058ff87c5b5bd62fc4fb4c7944fcb2c4d87f245281ed965225cee874b29c81f771136f6d9755271bcce360549ec1ffad246bc82e
|
7
|
+
data.tar.gz: a5e598744febe482485daf6c26fc7f40a6113d793fb6eac72985a8c27a52b23a796ee38c4edde024992d3f61770607932834959137a4a6c6ef095636982fc43a
|
@@ -22,21 +22,21 @@ def scheme
|
|
22
22
|
@scheme ||= node[:anyenv][:scheme] || 'git'
|
23
23
|
end
|
24
24
|
|
25
|
-
def install_envs(attributes)
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
# def install_envs(attributes)
|
26
|
+
# attributes[:install_versions].each do |envs|
|
27
|
+
# envs.each do |env, vers|
|
28
|
+
# install('anyenv', env)
|
29
29
|
|
30
|
-
|
30
|
+
# vers.each { |ver| install(env, ver) }
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end
|
32
|
+
# global_version(env, vers.first)
|
33
|
+
# end
|
34
|
+
# end
|
35
|
+
# end
|
36
36
|
|
37
|
-
def install(from, to)
|
38
|
-
|
39
|
-
end
|
37
|
+
# def install(from, to)
|
38
|
+
# execute anyenv_init_with(@root_path, "yes | #{from} install #{to};")
|
39
|
+
# end
|
40
40
|
|
41
41
|
def init(username)
|
42
42
|
@username = username
|
@@ -103,46 +103,57 @@ def clone_anyenv_update
|
|
103
103
|
clone_repository(install_path, repo_path)
|
104
104
|
end
|
105
105
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
106
|
+
def install_envs(attributes)
|
107
|
+
attributes[:install_versions].each do |envs|
|
108
|
+
envs.each do |env, vers|
|
109
|
+
install_env(env)
|
110
110
|
|
111
|
-
|
112
|
-
|
113
|
-
|
111
|
+
vers.each do |ver|
|
112
|
+
install_env_version(env, ver)
|
113
|
+
end
|
114
114
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
115
|
+
global_version(env, vers.first)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
119
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
# not_if "type #{envname}"
|
126
|
-
# end
|
127
|
-
# end
|
120
|
+
def install_env(envname)
|
121
|
+
exec = anyenv_init_with @root_path, <<-EOS
|
122
|
+
"yes | anyenv install #{version}"
|
123
|
+
EOS
|
124
|
+
is_exec = anyenv_init_with @root_path, "type #{envname}"
|
128
125
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
126
|
+
execute "install #{envname}" do
|
127
|
+
user @username if @username
|
128
|
+
command exec
|
129
|
+
not_if is_exec
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def install_env_version(envname, version)
|
134
|
+
exec = anyenv_init_with @root_path, <<-EOS
|
135
|
+
"yes | #{envname} install #{version}"
|
136
|
+
EOS
|
137
|
+
is_exec = anyenv_init_with @root_path, "#{envname} versions | grep #{version}"
|
138
|
+
|
139
|
+
execute "#{envname} install #{version}" do
|
140
|
+
user @username if @username
|
141
|
+
command exec
|
142
|
+
not_if is_exec
|
143
|
+
end
|
144
|
+
end
|
136
145
|
|
137
146
|
def global_version(envname, version)
|
138
147
|
exec = anyenv_init_with @root_path, <<-EOS
|
139
|
-
|
140
|
-
|
141
|
-
|
148
|
+
#{envname} global;
|
149
|
+
#{version}; #{envname} rehash;
|
150
|
+
EOS
|
151
|
+
is_exec = anyenv_init_with @root_path, "#{envname} global | grep #{version}"
|
152
|
+
|
142
153
|
execute "#{envname} global #{version}" do
|
143
|
-
|
154
|
+
user @username if @username
|
144
155
|
command exec
|
145
|
-
|
156
|
+
not_if is_exec
|
146
157
|
end
|
147
158
|
# execute "#{envname} global #{version}" do
|
148
159
|
# user @username if @username
|