关于代码的解释

发布于 2024-10-11 03:41:40 字数 252 浏览 4 评论 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 的信息,

提前感谢您的帮助

I have some script and I have no idea what it is doing, will be happy if somebody will explain me:

#!/bin/tcsh

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

cd tests
python test_some.py $argv

P.S can't find info about functions cd and svn

thanks in advance for any help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

怼怹恏 2024-10-18 03:41:40

该脚本运行第二个版本控制的测试脚本


该脚本运行一个 python 程序,该程序似乎运行一些测试。该脚本知道测试目录存储在 subversion 存储库中。

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

我对一件事有点困惑。它检查了“test”,但随后将其目录更改为“tests”。因此,要么原始帖子中存在转录错误,要么发生了稍微复杂的情况,就像,它以某种方式假设 tests 存在,但不存在 test

The script runs a second revision-controlled test script


This script runs a python program which appears to run some tests. The script understands that the test directory is stored in a subversion repository.

  • If there is a test directory, it updates it in case it has been changed in the repository, perhaps by another svn user or by the same user in a different working directory.
  • If there is no test directory, it checks it out.
  • Then it changes its current directory to the working directory.
  • Then it runs the test script.

I'm a bit confused about one thing. It checks out "test" but then changes its directory to "tests". So either there is a transcription error in the original post or something slightly more complex is going on, like, it somehow assumes that tests exists but not test.

薄情伤 2024-10-18 03:41:40

cd 是“更改目录”命令。

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

cd is the "Change Directory" command.

svn is a source code repository client.

好久不见√ 2024-10-18 03:41:40

该脚本执行以下操作:

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.

The script does the following:

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.
伤感在游骋 2024-10-18 03:41:40

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

cd, and svn, and python are executable names. cd is the command for changing current directory. svn is the command (executable name) for Subversion source control system. python is the Python language interpreter.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文