diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fcbe0663..10f0f0c9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ BUG FIXES: - Solaris guests actually shut down properly. [GH-1506] - All provisioners only output newlines when the provisioner sends a newline. This results in the output looking a lot nicer. + - Sharing folders works properly if ".profile" contains an echo. [GH-1677] ## 1.2.4 (July 16, 2013) diff --git a/plugins/guests/linux/cap/shell_expand_guest_path.rb b/plugins/guests/linux/cap/shell_expand_guest_path.rb index 983e366f0..114edc415 100644 --- a/plugins/guests/linux/cap/shell_expand_guest_path.rb +++ b/plugins/guests/linux/cap/shell_expand_guest_path.rb @@ -4,13 +4,16 @@ module VagrantPlugins class ShellExpandGuestPath def self.shell_expand_guest_path(machine, path) real_path = nil - machine.communicate.execute("printf #{path}") do |type, data| + machine.communicate.execute("echo; printf #{path}") do |type, data| if type == :stdout real_path ||= "" real_path += data end end + # The last line is the path we care about + real_path = real_path.split("\n").last.chomp + if !real_path # If no real guest path was detected, this is really strange # and we raise an exception because this is a bug.