Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Make post-provision.sh script less opinionated #1264

Closed
geerlingguy opened this issue Mar 27, 2017 · 2 comments
Closed

Make post-provision.sh script less opinionated #1264

geerlingguy opened this issue Mar 27, 2017 · 2 comments
Assignees
Labels
Enhancement A feature or feature request

Comments

@geerlingguy
Copy link
Contributor

geerlingguy commented Mar 27, 2017

My system information:

  • Operating system type: macOS or Windows 7/8/10
  • Operating system version: 10.12.3 or 7/8/10
  • BLT version: 8.6.15

When I run this command:

/var/www/project/vendor/acquia/blt/scripts/drupal-vm/post-provision.sh

I get the following output:

Either:

bash\r: No such file or directory\n

or:

vagrant@local:/var/www/beagov$ ./vendor/acquia/blt/scripts/drupal-vm/post-provision.sh
grep: /vagrant/box/config.yml: No such file or directory
./vendor/acquia/blt/scripts/drupal-vm/post-provision.sh: line 9: temp: Permission denied

And I expected this to happen:

The BLT alias should be added successfully.

Summary

Basically, there are a two assumptions made in this script which may not be universally true:

  1. The script will always be run when there is a valid /vagrant mount. This may not be true if you're trying to use any type of VM-like environment outside of Drupal VM-created-inside-a-BLT-project.
  2. env bash will always be available.

So to fix... could we:

  1. Use #!/bin/bash instead of #!/usr/bin/env bash in the top of the script?
  2. Maybe put lines 4-6 (https://github.com/acquia/blt/blob/8.x/scripts/drupal-vm/post-provision.sh#L4-L6) in a conditional, checking if we're currently in a project directory root... and if not, don't run that stuff?
@geerlingguy
Copy link
Contributor Author

Happy to take a stab at it later, don't have the time right now (end of day and all that).

@geerlingguy
Copy link
Contributor Author

Working on it now :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement A feature or feature request
Projects
None yet
Development

No branches or pull requests

2 participants