0

我有一些脚本,但我不知道它在做什么,如果有人能解释我会很高兴:

#!/bin/tcsh

if (-d test) then
    svn up test
else
    svn checkout http:some address test
endif

cd tests
python test_some.py $argv

PS 找不到关于函数 cd 和 svn 的信息

提前感谢您的帮助

4

4 回答 4

1

该脚本运行第二个受修订控制的测试脚本


该脚本运行一个似乎运行一些测试的 python 程序。该脚本了解测试目录存储在颠覆存储库中。

  • 如果有一个测试目录,它会更新它,以防它在存储库中被更改,可能由另一个 svn 用户或不同工作目录中的同一用户更改。
  • 如果没有测试目录,它会检查它。
  • 然后它将其当前目录更改为工作目录。
  • 然后它运行测试脚本。

我对一件事有点困惑。它签出“test”,然后将其目录更改为“tests”。因此,要么原始帖子中存在转录错误,要么发生了一些更复杂的事情,例如,它以某种方式假设存在测试但不存在测试

于 2011-01-09T23:05:21.437 回答
0

cd是“更改目录”命令。

svn是一个源代码存储库客户端。

于 2011-01-09T23:04:59.940 回答
0

该脚本执行以下操作:

if the test folder exists
    update it through subversion
else
    check it out from subversion repository

go into the tests directory // interestingly enough, it doesn't match the checked out directory name?
run the test_some.py python file, passing the script arguments.
于 2011-01-09T23:06:01.643 回答
0

cd、svn 和 python 是可执行文件名。cd 是更改当前目录的命令。svn 是 Subversion 源代码控制系统的命令(可执行文件名)。python 是 Python 语言解释器。

于 2011-01-09T23:07:23.300 回答