This repository was archived by the owner on Feb 13, 2023. It is now read-only.
This repository was archived by the owner on Feb 13, 2023. It is now read-only.
Cannot write to file via post_provision_scripts #880
Closed
Description
After provisioning my box I want to add the path of my composer vendor/bin dir which contains local versions of Drupal Console and Drush downloaded via composer.
To do this I have the following in my config.yml:
post_provision_scripts:
- "{{ config_dir }}/../scripts/vagrant-post-provision.sh"
My vagrant-post-provision.sh looks like this:
#!/bin/bash
# Add local Drush and Drupal Console to PATH
if ! grep -q /var/www/site/vendor/bin "$HOME/.profile" ; then
sudo echo "export PATH=/var/www/site/vendor/bin:$PATH" >> $HOME/.profile
else
exit 0
fi
I don't get any errors while provisioning and it runs the task according to the console output.
However my ~/.profile file does not change.
If I manually do vagrant ssh
and run the command
sh /var/www/site/scripts/vagrant-post-provision.sh
It adds a row to my ~/.profile as expected.
Any idea what I might be doing wrong?
Metadata
Metadata
Assignees
Labels
No labels