Dao*_*Lam 1 bash shell workspace perforce
我正在写一些脚本,但我需要先从P4获取源代码.如何在脚本中编辑客户端工作区?
以下是我通常使用bash执行的步骤:
export P4CLIENT=myworkspace
p4 client
//now I manually edit the source and destination directory using Vim
p4 sync
Run Code Online (Sandbox Code Playgroud)
提前致谢!!!
p4 client 可以使用标准输入和输出.
export P4CLIENT=myworkspace
p4 client -o > /tmp/myclient.$$ # Write client to a temp file
# Commands to update /tmp/myclient with the changes you need
p4 client -i < /tmp/myclient.$$
p4 sync
rm /tmp/myclient.$$
Run Code Online (Sandbox Code Playgroud)