Compatibility changes to support Windows/Busybox:

* don't rely on symbolic links on the host
* apply a slight change to a sed command (no "\n")
This commit is contained in:
Jimmy Monin 2017-09-14 18:52:31 +02:00
parent 28889a2532
commit f2a20e3c7d

14
ynh-dev Executable file → Normal file
View file

@ -98,7 +98,7 @@ elif [ "$1" = "create-env" ]; then
# Get YunoHost Vagrantfile
git clone -b master https://github.com/YunoHost/Vagrantfile vagrant
ln -s vagrant/Vagrantfile Vagrantfile
cp vagrant/Vagrantfile Vagrantfile
# Get YunoHost dev tools
git clone -b master https://github.com/YunoHost/ynh-dev ynh-dev-tools
@ -163,17 +163,17 @@ elif [ "$1" = "run" ]; then
git pull
popd &> /dev/null
rm ./Vagrantfile
ln -s vagrant/Vagrantfile Vagrantfile
cp vagrant/Vagrantfile Vagrantfile
}
# Adapt vagrantfile
sed -i "/ ### END AUTOMATIC YNH-DEV ###/ i \\
config.vm.define \"${VMNAME}\" do |${VMNAME}| \
\n ${VMNAME}.vm.box = \"yunohost/jessie-${VERSION}\" \
\n ${VMNAME}.vm.network :private_network, ip: \"${IP}\" \
\n end \
\n" ./Vagrantfile
config.vm.define \"${VMNAME}\" do |${VMNAME}| \\
${VMNAME}.vm.box = \"yunohost/jessie-${VERSION}\" \\
${VMNAME}.vm.network :private_network, ip: \"${IP}\" \\
end \\
" ./Vagrantfile
}
# Run VM