シンボリックリンクを使用し/usr/bin
て正確なファイルを指すこともできます。これは、システムで複数のバージョンの play を使用している場合に便利です。
ところで(前の質問で逆の操作を実行したことがわかります:)-前の/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
もちろん、で作成されたアプリケーションで command を使用することはできませんplay-master new ...
。