Update IPFS to the latest release

Also fix the ipfs config
This commit is contained in:
Greg Karékinian
2018-04-17 18:51:53 +02:00
parent b4624cf2aa
commit 11db96b3a1
6 changed files with 13 additions and 27 deletions

View File

@@ -8,8 +8,7 @@ end
action :create do
include_recipe "ipfs"
json_value = JSON.generate(value)
execute "ipfs config --json #{key} #{json_value}" do
execute "ipfs config --json #{key} '#{value}'" do
environment "IPFS_PATH" => "/home/ipfs/.ipfs"
user "ipfs"
not_if do
@@ -20,9 +19,9 @@ action :create do
env: { "IPFS_PATH" => "/home/ipfs/.ipfs" })
cmd.run_command
begin
JSON.parse(cmd.stdout) == value
JSON.parse(cmd.stdout) == JSON.parse(value)
rescue JSON::ParserError
cmd.stdout.include?(value)
cmd.stdout.include?("#{value}")
end
end
notifies :restart, "service[ipfs]", :delayed