您还可以使用符号链接/usr/bin
来指向确切的文件,当您在系统上使用多个版本的播放时,这很有用
顺便说一句(我可以看到您在上一个问题中执行了反向操作:) - 删除了上一个:/usr/bin/play 命令)
(分别粘贴每一行并确认):
sudo -i
cd /usr/bin
chmod +x /Users/ronyjohn007/Documents/play-2.0.3/play
ln -ls /Users/ronyjohn007/Documents/play-2.0.3/play play
exit
其他样本 -git master
在这种情况下
# this creates new folder in your docs,
# and clones current master version of Play from GitHub to
# /Users/ronyjohn007/Documents/play-from-github/Play20 folder
cd ~/Documents
mkdir play-from-github
cd play-from-github/
git clone https://github.com/playframework/Play20.git
# this sets alternative command as in sample 1
sudo -i
cd /usr/bin
chmod +x /Users/ronyjohn007/Documents/play-from-github/Play20/play
ln -ls /Users/ronyjohn007/Documents/play-from-github/Play20/play play-master
exit
最后,现在您可以检查哪个命令指向哪个版本:
ls -la /user/bin | grep play
应该给出类似的东西:
... play -> /Users/ronyjohn007/Documents/play-2.0.3/play
... play-master -> /Users/ronyjohn007/Documents/play-from-github/Play20/play
终端重新打开后,它们都应该可以作为常用命令使用。
注意:当然,您不能将play
命令用于创建的应用程序,play-master new ...
反之亦然!