Skip to content
This repository has been archived by the owner on Jan 16, 2018. It is now read-only.

Work around Windows file path length restrictions #100

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules
/build
.vagrant
npm-debug.log*
24 changes: 20 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

_script = <<SCRIPT
_SCRIPT = <<SCRIPT
set -o errexit
set -o pipefail
set -o nounset
shopt -s failglob
set -o xtrace

export DEBIAN_FRONTEND=noninteractive
curl -sL https://deb.nodesource.com/setup_iojs_1.x | sudo bash -
apt-get install -y iojs
%s

export DEBIAN_FRONTEND=noninteractive
curl -sL https://deb.nodesource.com/setup_iojs_1.x | bash -
apt-get install -y iojs build-essential

exec sudo -i -u vagrant /bin/bash -- << EOF
cd /vagrant
Expand All @@ -20,6 +21,13 @@ npm install
EOF
SCRIPT

_SCRIPT_WIN = <<SCRIPT
rm -Rf /vagrant/node_modules
mkdir -p /var/tmp/vagrant/node_modules
chown vagrant:vagrant /var/tmp/vagrant/node_modules
ln -s /var/tmp/vagrant/node_modules /vagrant/node_modules
SCRIPT

Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"

Expand All @@ -28,7 +36,15 @@ Vagrant.configure("2") do |config|
v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end

# Work around Windows file path length restrictions
if Vagrant::Util::Platform.windows?
_script = _SCRIPT % _SCRIPT_WIN
else
_script = _SCRIPT % ""
end

config.vm.provision "shell", inline: _script

config.vm.network "forwarded_port", guest: 8080, host: 8080
config.vm.network "forwarded_port", guest: 2992, host: 2992
end