diff --git a/lib/application_manager/task.rb b/lib/application_manager/task.rb index 560c82d..0b65b03 100644 --- a/lib/application_manager/task.rb +++ b/lib/application_manager/task.rb @@ -98,8 +98,8 @@ class W3DHub # Quick checks before network and computational work starts def fail_fast # tar present? - bsdtar_present = system("bsdtar --help") - fail!("FAIL FAST: `bsdtar --help` command failed, bsdtar is not installed. Will be unable to unpack packages.") unless bsdtar_present + bsdtar_present = system("#{W3DHub.tar_command} --help") + fail!("FAIL FAST: `#{W3DHub.tar_command} --help` command failed, #{W3DHub.tar_command} is not installed. Will be unable to unpack packages.") unless bsdtar_present if W3DHub.unix? wine_present = system("which #{window.settings[:wine_command]}") @@ -263,8 +263,8 @@ class W3DHub puts " #{package.name}:#{package.version}" package_path = Cache.package_path(package.category, package.subcategory, "#{package.name}.zip", package.version) - puts " Running bsdtar command: #{"bsdtar -xf #{package_path} -C #{path}"}" - status = system("bsdtar -xf #{package_path} -C #{path}") + puts " Running #{W3DHub.tar_command} command: #{"#{W3DHub.tar_command} -xf #{package_path} -C #{path}"}" + status = system("#{W3DHub.tar_command} -xf #{package_path} -C #{path}") if status else puts "COMMAND FAILED!" diff --git a/lib/common.rb b/lib/common.rb index d3d8ee8..fcd04ab 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -32,6 +32,14 @@ class W3DHub linux? || mac? end + def self.tar_command + if windows? + "tar" + else + "bsdtar" + end + end + def self.home_directory File.expand_path("~") end