Update golang cookbook
This commit is contained in:
@@ -1,26 +1,23 @@
|
||||
#
|
||||
# Author:: Annih (<b.courtois@criteo.com>)
|
||||
# Cookbook:: seven_zip
|
||||
# Resource:: tool
|
||||
#
|
||||
# Copyright:: 2018, Baptiste Courtois
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
property :package, ::String, default: lazy { node['seven_zip']['package_name'] }
|
||||
property :source, ::String, default: lazy { node['seven_zip']['url'] }
|
||||
property :checksum, [::NilClass, ::String], default: lazy { node['seven_zip']['checksum'] }
|
||||
property :path, [::NilClass, ::String], default: lazy { node['seven_zip']['home'] }
|
||||
unified_mode true
|
||||
|
||||
property :package,
|
||||
String,
|
||||
description: 'Name of the package to install.',
|
||||
default: node['kernel']['machine'] == 'x86_64' ? '7-Zip 19.00 (x64 edition)' : '7-Zip 19.00'
|
||||
|
||||
property :source,
|
||||
String,
|
||||
description: 'Source URL of the package to install.',
|
||||
default: node['kernel']['machine'] == 'x86_64' ? 'https://www.7-zip.org/a/7z1900-x64.msi' : 'https://www.7-zip.org/a/7z1900.msi'
|
||||
|
||||
property :checksum,
|
||||
String,
|
||||
description: 'Checksum for the downloaded pacakge.',
|
||||
default: node['kernel']['machine'] == 'x86_64' ? 'a7803233eedb6a4b59b3024ccf9292a6fffb94507dc998aa67c5b745d197a5dc' : 'b49d55a52bc0eab14947c8982c413d9be141c337da1368a24aa0484cbb5e89cd'
|
||||
|
||||
property :path,
|
||||
String,
|
||||
description: 'Optional: path to install 7zip to.'
|
||||
|
||||
action :install do
|
||||
windows_package new_resource.package do
|
||||
@@ -38,6 +35,12 @@ action :add_to_path do
|
||||
end
|
||||
end
|
||||
|
||||
action :remove do
|
||||
windows_package new_resource.package do
|
||||
action :remove
|
||||
end
|
||||
end
|
||||
|
||||
action_class do
|
||||
REG_PATH = 'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\7zFM.exe'.freeze
|
||||
|
||||
|
||||
Reference in New Issue
Block a user