如何在Mac OS X中安装OCLint

3
我正在尝试在我的MAC OS X Mavericks中安装OCLint,其文档here指出:
*以下代码片段是.bashrc或者.bash_profile文件的示例,这个文件会在终端启动时自动执行。*
OCLINT_HOME=/path/to/oclint-release
export PATH=$OCLINT_HOME/bin:$PATH

我该如何完成这个任务?我需要创建.bashrc或.bash_profile文件,还是添加到现有文件中?.bashrc或.bash_profile文件在哪里可以找到?

1
OCLint是一个独立的工具,可在Linux和Mac OS X平台上运行。 - El Tomato
4个回答

11

使用Homebrew快速安装Oclint是一个方便的解决方案。 首先打开终端并安装Homebrew:

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.

2017年7月31日更新:

before_install:

  • brew cask uninstall oclint
  • brew tap oclint/formulae
  • brew install oclint

9

4

如果你在你的主目录下(即/Users/yourname/)已经有一个.bashrc文件,那么只需在该文件中添加以下几行。否则,请新建一个.bashrc文件,并将以下两行内容写入其中。然后执行以下操作:

$ source ~/.bashrc

2
这些文件应该在你的主目录中,但由于前导点,它们将默认隐藏。你可以启用“显示所有文件”功能在Finder中查看它们。或者,如果你熟悉使用终端应用程序,可以从终端编辑文件并添加OCLint的行。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接