Created
March 10, 2016 16:36
-
-
Save merlinstardust/34d32cb861c608a1d50e to your computer and use it in GitHub Desktop.
Mounts Node node_modules directories within Vagrant so apps can run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.vm.provision "node_modules mounting", type: "shell", run: "always" do |shell| | |
shell.privileged = false | |
shell.args = "'#{app_name}'" | |
shell.inline = <<-SHELL | |
echo "Mounting node_modules directories" | |
for directory in /$1/*; do | |
if [ -f $directory/package.json ]; then | |
mkdir -p $directory/node_modules | |
mkdir -p /home/vagrant$directory/node_modules | |
sudo mount --bind /home/vagrant$directory/node_modules $directory/node_modules | |
fi | |
done | |
echo "Directories created" | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's
'#{app_name}'
I am getting an error
undefined local variable or method 'app_name'