歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Cocos2D 2.0 模板安裝無權限問題的解決辦法

Cocos2D 2.0 模板安裝無權限問題的解決辦法

日期:2017/3/1 10:17:13   编辑:Linux編程

今天更新下模板,發現使用./install-templates.sh -f 命令進行安裝cocos2d 2.0 模板,總是返回以下信息

  1. LiumatoMac-mini:cocos2d-iphone-2.0 liuyanghui$ sudo ./install-templates.sh
  2. cocos2d-iphone template installer
  3. Error: Do not run this script as root.
  4. 'root' is no longer supported
  5. RECOMMENDED WAY:
  6. ./install-templates.sh -f

我已經是root權限了,但是腳本總是不能識別我使用的root權限安裝。看了下腳本,發現是幾句代碼在驗證:

  1. # Make sure root is not executed
  2. if [[ "$(id -u)" == "0" ]]; then
  3. echo ""
  4. echo "Error: Do not run this script as root." 1>&2
  5. echo ""
  6. echo "'root' is no longer supported" 1>&2
  7. echo ""
  8. echo "RECOMMENDED WAY:" 1>&2
  9. echo " $0 -f" 1>&2
  10. echo ""
  11. exit 1
  12. fi

所以把這段判決root權限對腳本代碼去掉

然後使用命令 sudo sh ./install-templates.sh -f 進行安裝。此時發現可以安裝成功了。

如果出現輸入password的話,就輸入password。

Copyright © Linux教程網 All Rights Reserved