I tried to install drush with composer from a script that is runing with sudo
$nameofuser `logname`
#drush installation
getcomposer(){
# Composer Global installation
curl -sS https://getcomposer.org/installer | php > /dev/null 2>&1
mv composer.phar /usr/local/bin/composer > /dev/null 2>&1
sed -i '1i export PATH="/home/"$nameofuser"/.composer/vendor/bin:$PATH"' /home/"$nameofuser"/.bashrc > /dev/null 2>&1
source /home/"$nameofuser"/.bashrc
}
getdrush(){
composer global require drush/drush:dev-master > /dev/null 2>&1
if [ -f /usr/bin/drush ]; then
rm "/usr/bin/drush"
ln -s /home/"$nameofuser"/.comoser/vendor/drush/drush/drush /bin/drush
else
ln -s /home/"$nameofuser"/.comoser/vendor/drush/drush/drush /bin/drsuh
fi
}
The restult is
lrwxrwxrwx 1 root root Dec 28 14:55 drush --> /home/user/.comoser/vendor/drush/drush/drush
drush command is not working instead ubuntu displays
The programm drush ist corrently not installed you can install it by typing:
sudo apt-get install drush
The result of
echo $PATH
is
/home//.comoser/vendor/bin:/home//.comoser/vendor/bin:/usr/local/sbin:/usr/local
/bin:/usr/sbin:user/bin:/sbin:/bin:usr/games:/usr/local/games
What is wrong here? how to get the $namefuser variable in to the $PATH, correctly, Why is the symbolic link to drush not working?
Aucun commentaire:
Enregistrer un commentaire