Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install BLT alias automatically for developers #284

Closed
danepowell opened this issue Aug 12, 2016 · 4 comments
Closed

Install BLT alias automatically for developers #284

danepowell opened this issue Aug 12, 2016 · 4 comments
Labels
Enhancement A feature or feature request

Comments

@danepowell
Copy link
Contributor

When a developer clones a project repo built on the new composer-based BLT, they have to do something like this:

  1. composer install
  2. ./vendor/bin/blt local:setup

I think we could consolidate this to automatically run the local setup as part of the composer install. We should at least install the BLT alias so they don't have to poke around the vendor directory for the BLT binary.

@grasmash
Copy link
Contributor

In order to do this, we'd need to either:

  • Have the project's composer file contain a post-update-cmd script, or
  • Define blt as a composer plugin in the way that cweagens/composer-patches does

@grasmash grasmash added ready Enhancement A feature or feature request labels Aug 15, 2016
@pixlkat
Copy link
Contributor

pixlkat commented Aug 24, 2016

I've been investigating how to accomplish this today. In its current form, the install-alias.sh script requires appropriate input from a prompt before it will actually install the alias. Scripts run as composer scripts do not support user input as a response to a prompt from a shell script. See composer/composer#4036.

It is relatively straightforward to add a script definition to template/composer.json so that the script can be run, however if the alias does not already exist it is not created. If we want to go this route, we will need to modify the script so that it will check for a "-y" flag so it doesn't need to ask when running the command from composer.

I think running blt local:setup automatically is not really feasible since between setting up the project directories and installing everything, the local dev environment needs to be set up. I think the best we can do here is to run blt setup:drupal:settings.

pixlkat added a commit to pixlkat/blt that referenced this issue Aug 25, 2016
grasmash added a commit to grasmash/bolt that referenced this issue Sep 9, 2016
grasmash added a commit to grasmash/bolt that referenced this issue Sep 9, 2016
grasmash added a commit to grasmash/bolt that referenced this issue Sep 9, 2016
grasmash added a commit that referenced this issue Sep 9, 2016
Fixes #341 #284: Automating alias installation and template updates.
@grasmash
Copy link
Contributor

grasmash commented Sep 9, 2016

Installing automatically causes issues in some environments, E.g., we don't want aliases installed for us on Travis CI, and some people may use tools like fish, in which case adding the alias automatically will be unwelcome. But as as compromise I've made it much simpler: composer blt-alias.

I don't think we should run local:setup because some people may be adding blt to an existing codebase with an existing db, which would be dropped.

@kevinquillen
Copy link

kevinquillen commented Dec 9, 2016

One slight thing, the same function that works in fish, causes zsh to exit to iTerm/Term or the window itself will close (if zsh is set as default shell) if blt is ran in a directory fails the conditions in the function mentioned in #662

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

No branches or pull requests

4 participants