diff --git a/lib/vagrant/action/general/package.rb b/lib/vagrant/action/general/package.rb index 99c0002ec..58991222c 100644 --- a/lib/vagrant/action/general/package.rb +++ b/lib/vagrant/action/general/package.rb @@ -29,9 +29,10 @@ module Vagrant def call(env) @env = env - + file_name = File.basename(@env["package.output"].to_s) + raise Errors::PackageOutputDirectory if File.directory?(tar_path) - raise Errors::PackageOutputExists if File.exist?(tar_path) + raise Errors::PackageOutputExists, file_name:file_name if File.exist?(tar_path) raise Errors::PackageRequiresDirectory if !env["package.directory"] || !File.directory?(env["package.directory"]) diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 908f8e82d..e5bf4fffa 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -1749,7 +1749,7 @@ en: packaging: "Packaging additional file: %{file}" compressing: "Compressing package to: %{tar_path}" output_exists: |- - The specified file to save the package as already exists. Please + The specified file '%{file_name}' to save the package as already exists. Please remove this file or specify a different file name for outputting. output_is_directory: |- The specified output is a directory. Please specify a path including