File tree 1 file changed +3
-21
lines changed
1 file changed +3
-21
lines changed Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
- if platform? ( 'windows' )
4
- src = node [ 'nssm' ] [ 'src' ]
5
- basename = src . slice ( src . rindex ( '/' ) + 1 , src . rindex ( '.' ) - src . rindex ( '/' ) - 1 )
6
- system = node [ 'kernel' ] [ 'machine' ] == 'x86_64' ? 'win64' : 'win32'
7
- system_file = "#{ Chef ::Config [ :file_cache_path ] } /#{ basename } /#{ system } /nssm.exe"
8
-
9
- windows_zipfile 'download nssm' do
10
- path Chef ::Config [ :file_cache_path ]
11
- source src
12
- overwrite true
13
- checksum node [ 'nssm' ] [ 'sha256' ]
14
- action :unzip
15
- notifies :create , 'remote_file[install nssm]' , :immediately
16
- end
17
-
18
- remote_file 'install nssm' do
19
- path ::NSSM . binary_path node
20
- source "file:///#{ system_file } "
21
- end
22
- else
23
- Chef ::Log . warn ( 'NSSM can only be installed on Windows platforms!' )
3
+ nssm_install 'Install NSSM' do
4
+ source node [ 'nssm' ] [ 'src' ]
5
+ sha256 node [ 'nssm' ] [ 'sha256' ]
24
6
end
You can’t perform that action at this time.
0 commit comments