From 4d76327382a2e17c47ba53515e3b7c53ed20e0a0 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 12 Jun 2014 11:38:53 -0700 Subject: [PATCH] guests/freebsd: style --- plugins/guests/freebsd/cap/rsync.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/guests/freebsd/cap/rsync.rb b/plugins/guests/freebsd/cap/rsync.rb index f9174b201..2876b5943 100644 --- a/plugins/guests/freebsd/cap/rsync.rb +++ b/plugins/guests/freebsd/cap/rsync.rb @@ -7,14 +7,13 @@ module VagrantPlugins machine.communicate.execute("uname -r") do |type, result| version = result.split('.')[0].to_i if type == :stdout end - if version >= 10 + + pkg_cmd = "pkg_add -r" + if version && version >= 10 pkg_cmd = "pkg install -y" - else - pkg_cmd = "pkg_add -r" - end - machine.communicate.tap do |comm| - comm.sudo(pkg_cmd+" rsync") end + + machine.communicate.sudo("#{pkg_cmd} rsync") end def self.rsync_installed(machine)