Vagrant 设置可能不存在的同步文件夹
在我的Vagrant文件中,我设置了一个同步文件夹,例如Vagrant 设置可能不存在的同步文件夹,vagrant,vagrantfile,Vagrant,Vagrantfile,在我的Vagrant文件中,我设置了一个同步文件夹,例如 node_config.vm.synced_folder "../.", "/proj_root" 这个很好用。我想添加主机上可能不存在源目录的其他同步文件夹。当vagrant运行时,它报告找不到源目录 There are errors in the configuration of this machine. Please fix the following errors and try again: vm: * The host
node_config.vm.synced_folder "../.", "/proj_root"
这个很好用。我想添加主机上可能不存在源目录的其他同步文件夹。当vagrant运行时,它报告找不到源目录
There are errors in the configuration of this machine. Please fix
the following errors and try again:
vm:
* The host path of the shared folder is missing: ../../test_no_such_dir
我理解这个错误,但是,我正在寻找一种可以选择设置synced_文件夹的方法。如果目录不存在,也许我可以在目录上运行mkdir来创建它们,但我不确定是否可以在Vagrant文件中运行任意命令。我可以使用这些命令。其中之一是create
,如果源目录不存在,它将创建源目录
node_config.vm.synced_folder "../../test_no_such", "/test_no_such", create:true