itamae-plugin-recipe-anyenv 0.3.41 → 0.3.42
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 +1 -57
- 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: d32d67c44d0ed85ba6123d731c9e22da38295410
|
4
|
+
data.tar.gz: f9021c3d0e5d39688fdc7275c51242900b8be01f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ee0c604deb1bf5d1281fe7c250c1a72a78df0f6c153078ac9269fc52a292eed1616cf5a25e20c526c12137e5b84997dedf273b6d37388527235a9607c1de7a9
|
7
|
+
data.tar.gz: 08ba14bc4a850a8bf219f538424d22a387fb9b6e014740959adeea35192f1f27c64802108cc35e796b5802ef80917ce0ff9d09be481613f7c7efb4b08afeb431
|
@@ -22,22 +22,6 @@ def scheme
|
|
22
22
|
@scheme ||= node[:anyenv][:scheme] || 'git'
|
23
23
|
end
|
24
24
|
|
25
|
-
# def install_envs(attributes)
|
26
|
-
# attributes[:install_versions].each do |envs|
|
27
|
-
# envs.each do |env, vers|
|
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(@root_path, "yes | #{from} install #{to};")
|
39
|
-
# end
|
40
|
-
|
41
25
|
def init(username)
|
42
26
|
@username = username
|
43
27
|
@root_path = ENV['ANYENV_ROOT'] || DEFAULT_ANYENV_ROOT
|
@@ -52,38 +36,6 @@ def anyenv_init_with(root_path, command)
|
|
52
36
|
EOS
|
53
37
|
end
|
54
38
|
|
55
|
-
# def anyenv_root(username)
|
56
|
-
# return anyenv_system_root if username.nil?
|
57
|
-
# anyenv_user_root(username)
|
58
|
-
# end
|
59
|
-
|
60
|
-
# def anyenv_system_root
|
61
|
-
# if node[:anyenv] && node[:anyenv][:anyenv_root]
|
62
|
-
# return node[:anyenv][:anyenv_root]
|
63
|
-
# end
|
64
|
-
# return ENV['ANYENV_ROOT'] || DEFAULT_ANYENV_ROOT
|
65
|
-
# end
|
66
|
-
|
67
|
-
# def anyenv_user_root(username)
|
68
|
-
# if node[:anyenv][:users][username].key?(:anyenv_root)
|
69
|
-
# return node[:anyenv][:users][username][:anyenv_root]
|
70
|
-
# end
|
71
|
-
# case node[:platform]
|
72
|
-
# when 'darwin'
|
73
|
-
# "/Users/#{username}/.anyenv"
|
74
|
-
# else
|
75
|
-
# "/home/#{username}/.anyenv"
|
76
|
-
# end
|
77
|
-
# end
|
78
|
-
|
79
|
-
# def anyenv_init(root_path)
|
80
|
-
# <<-"EOS".gsub("\n", ' ')
|
81
|
-
# export ANYENV_ROOT=#{root_path};
|
82
|
-
# export PATH=#{root_path}/bin:${PATH};
|
83
|
-
# eval "$(anyenv init -)";
|
84
|
-
# EOS
|
85
|
-
# end
|
86
|
-
|
87
39
|
def clone_repository(install_path, repo_path)
|
88
40
|
git install_path do
|
89
41
|
user @username if @username
|
@@ -148,19 +100,11 @@ def global_version(envname, version)
|
|
148
100
|
#{envname} global;
|
149
101
|
#{version}; #{envname} rehash;
|
150
102
|
EOS
|
151
|
-
is_exec = anyenv_init_with @root_path, "#{envname}
|
103
|
+
is_exec = anyenv_init_with @root_path, "#{envname} versions | grep #{version}"
|
152
104
|
|
153
105
|
execute "#{envname} global #{version}" do
|
154
106
|
user @username if @username
|
155
107
|
command exec
|
156
108
|
not_if is_exec
|
157
109
|
end
|
158
|
-
# execute "#{envname} global #{version}" do
|
159
|
-
# user @username if @username
|
160
|
-
# command <<-EOS
|
161
|
-
# #{envname} global #{version};
|
162
|
-
# #{envname} rehash;
|
163
|
-
# EOS
|
164
|
-
# not_if "#{envname} global | grep #{version}"
|
165
|
-
# end
|
166
110
|
end
|