Skip to content

Commit

Permalink
Add project vendor/bin to PATH.
Browse files Browse the repository at this point in the history
  • Loading branch information
thom8 committed Jul 9, 2016
1 parent f96ff60 commit 270ddfb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ composer_global_packages: []

composer_add_to_path: true

# Add a project vendor/bin directory to the PATH
composer_add_project_to_path: false
#composer_project_path: /path/to/project/vendor/bin

# GitHub OAuth token (used to help overcome API rate limits).
composer_github_oauth_token: ''
3 changes: 3 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@

- include: global-require.yml
when: composer_global_packages|length > 0

- include: project-bin.yml
when: composer_add_project_to_path
6 changes: 6 additions & 0 deletions tasks/project-bin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Add composer_project_path bin directory to global $PATH.
template:
src: composer-project.sh.j2
dest: /etc/profile.d/composer-project.sh
mode: 0644
1 change: 1 addition & 0 deletions templates/composer-project.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export PATH=$PATH:{{ composer_project_path }}/vendor/bin

0 comments on commit 270ddfb

Please sign in to comment.