Is there a way to rename Hyperledger Fabric Composer command from 'composer' to something else?

Viewed 204

After installing Hyperledger Fabric Composer I have had to create an alias for PHP Composer 'composer' command as running the command executes Hyperledger Composer instead due to name conflict. Is there a way to rename the Hyperledger Fabric Composer command rather than doing this for PHP Composer as the PHP Composer gets executes automatically when installing a number of frameworks etc. and obviously this results in an error. It would seem to me to make more sense to rename / alias Hyperledger Composer as this is almost always manually executed. Any ideas over my current approach very welcome.

2 Answers

Yes. You can add an alias in your ~/.bashrc . For example to rename it fcomposer:

alias fcomposer=/usr/bin/composer

Or you can simply have a softlink from a directory in your path. For example,

ln -s /usr/bin/composer /usr/local/bin/fcomposer

Ok, so I have managed to solve the issue in a few steps. I like Dan's fcomposer name above so I will use that.

  1. Move the symlink for Hyperledger Composer (you can find out where it is located by running which composer at the prompt.
  2. Create an alias (in .bash_aliases) for fcmposer and point to the new symlink name
  3. Make sure your composer alias in .bashrc / .bash_aliases is linked to PHP composer

Going to +1 Dan's answer because it put me on the right path. Thanks Dan!

Related