S
S
Sergey Krivochenko2015-11-16 19:11:40
ubuntu
Sergey Krivochenko, 2015-11-16 19:11:40

How to install composer-asset-plugin when doing 'vagrant up'?

Good day to all.
I generate the config via puphpet.com . I would like the 'composer-asset-plugin' to be installed when the VM is initialized. As you know, this is done by the team

composer global require "fxp/composer-asset-plugin:~1.0.0"
I wrote a script that I put in the folder puphpet\files\exec-once:
#!/usr/bin/bash
echo "Installing Composer Asset Plugin"
composer global require "fxp/composer-asset-plugin:~1.0.0"

The plugin is installed, but in the /root/.composer folder. When I connect to the virtual machine through vagrant sshand try to execute composer install, I get an error due to the absence of this plugin in the /home/vagrant/.composer folder
Tried to switch user usingexpect
#!/usr/bin/bash
echo "Installing Composer Asset Plugin and Setup GitHub Access Token"
expect -c 'set timeout 3600; spawn su - vagrant; expect "Password:" {send -- "vagrant\r";}; exit 0'
composer global require fxp/composer-asset-plugin:~1.0.0;

It does not reach the plugin installation command. The script just hangs, as if waiting for something.
Who has what ideas? Thanks for the help!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question