2014-01-26 76 views
2

我想在我的Mac與Mac OS X小牛 其文檔here如何在Mac OS安裝OCLint X

*下面的代碼片段是對.bashrc或者.bash_profile中的例子來安裝OCLint文件是在終端啓動時提供的。*

OCLINT_HOME=/path/to/oclint-release 
export PATH=$OCLINT_HOME/bin:$PATH 

我該如何實現這一目標?是否需要創建.bashrc或.bash_profile文件,或添加到現有文件。我在哪裏可以找到.bashrc或者.bash_profile文件中

+1

「OCLint是運行在一個獨立的工具Linux和Mac OS X平臺。「 =>是什麼使它成爲一個編程問題? –

回答

4

如果你在你的主目錄有一個.bashrc(即/Users/yourname/.bashrc)已經然後只是追加這些行,否則,創建一個新的.bashrc包含這兩條線。那麼做到這一點:

$ source ~/.bashrc 
2

這些文件應該在你的主目錄,但他們會在默認情況下,由於前面的點被隱藏。您可以enable the "Show all files" feature在Finder中查看它們。或者,如果您習慣使用終端應用程序,請編輯終端中的文件並追加OCLint的行。

10

用Homebrew安裝Oclint是快速且有用的解決方案。 打開終端和安裝自制第一:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 

與該命令安裝Oclint 0.11.1

brew install https://gist.github.com/TonyAnhTran/e1522b93853c5a456b74/raw/2f440240fe99634771a3f2353c0c53a43c2d0fb2/oclint.rb 

要在終端創建的.bash_profile:

Type "cd ~/" to go to your home folder 
Type "touch .bash_profile" to create your new file. 
Edit .bash_profile with your favorite editor (or you can just type "open -e .bash_profile" to open it in TextEdit. 
Type ". .bash_profile" to reload .bash_profile and update any functions you add. 

更新上31-Jul-資料2017:

before_install:

  • 釀造的桶裝卸載oclint
  • 沖泡自來水oclint /公式
  • 釀造安裝oclint