Skip to content

Commit a44098f

Browse files
authored
update to use new nssm_install resource
1 parent 2bfce2f commit a44098f

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

recipes/default.rb

+3-21
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
# frozen_string_literal: true
22

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']
246
end

0 commit comments

Comments
 (0)