mirror of
https://github.com/YunoHost/ynh-dev.git
synced 2024-09-03 20:05:59 +02:00
macOS/BSD: fix Vagrantfile in-place editing
* Unlike GNU-sed, BSD-sed `-i` option requires an explicit backup extension. * Newlines are difficult to get right on different versions of `sed`. This commit replaces the `sed` invocation with `perl`. It does the same job with almost the same syntax, but avoids portability issues.
This commit is contained in:
parent
40b22fb02d
commit
25c24071bc
1 changed files with 3 additions and 3 deletions
6
ynh-dev
6
ynh-dev
|
@ -175,12 +175,12 @@ elif [ "$1" = "run" ]; then
|
||||||
}
|
}
|
||||||
|
|
||||||
# Adapt vagrantfile
|
# Adapt vagrantfile
|
||||||
sed -i "/ ### END AUTOMATIC YNH-DEV ###/ i \\
|
perl -i -pe "s| (### END AUTOMATIC YNH-DEV ###)|\
|
||||||
config.vm.define \"${VMNAME}\" do |${VMNAME}| \
|
config.vm.define \"${VMNAME}\" do \|${VMNAME}\| \
|
||||||
\n ${VMNAME}.vm.box = \"${BOX_NAME}\" \
|
\n ${VMNAME}.vm.box = \"${BOX_NAME}\" \
|
||||||
\n ${VMNAME}.vm.network :private_network, ip: \"${IP}\" \
|
\n ${VMNAME}.vm.network :private_network, ip: \"${IP}\" \
|
||||||
\n end \
|
\n end \
|
||||||
\n" ./Vagrantfile
|
\n \1|" ./Vagrantfile
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run VM
|
# Run VM
|
||||||
|
|
Loading…
Reference in a new issue