即使使用doc上提供的脚本,内联脚本也不起作用

时间:2013-12-28 12:06:32

标签: shell vagrant

我在创建目标文件夹后允许Vagrant继续使用synced_folder配置,因此我创建了我的bash脚本并在环境之外对其进行了测试。 这工作正常,所以我决定将其作为内联脚本移动,以使我的Vagrant文​​件易于阅读。

但是,我总是得到这个错误

Vagrant failed to initialize at a very early stage:

There is a syntax error in the following Vagrantfile. The syntax error
message is reproduced below for convenience:

/Users/andreamoro/Documents/Vagrant/MyVagrantExperiment/Vagrantfile:64: can't find string "SCRIPT" anywhere before EOF
/Users/andreamoro/Documents/Vagrant/MyVagrantExperiment/Vagrantfile:30: syntax error, unexpected end-of-input, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END

如果在Vagrant.configure(“2”)do | config |之间创建$ script变量,则使用为http://docs.vagrantup.com/v2/provisioning/shell.html的shell配置程序提供的示例会产生相同的输出。阻止,而如果脚本是在其外部创建的,则Vagrant根本不会执行它。

什么事? 谢谢 安德烈

1 个答案:

答案 0 :(得分:0)

Vagrant作者帮我解决了这个问题,确认了sync_folder方法隐藏的“创建”选项可用,但没有记录。

这里的完整主题。

https://github.com/mitchellh/vagrant/issues/2730