Improved the package error message

The package error message will now show the actual package name if the
package already existed.
This commit is contained in:
edward010 2015-02-26 18:31:01 +01:00 committed by Tim Rensen
parent ecf7bceb26
commit 51842623db
2 changed files with 4 additions and 3 deletions

View File

@ -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"])

View File

@ -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