Changing workspace clobber option directly from Perforce command line

前端 未结 3 748
误落风尘
误落风尘 2021-01-13 07:14

How to change perforce specs from command line? What I want to do is, I have a workspace whose clobber option is set to noclobber (default value). Now I want to

相关标签:
3条回答
  • 2021-01-13 07:49

    If you're trying to avoid repeatedly opening a text editor, you can accomplish your goal with a little bit of sed, like this:

    p4 client -o | \
    sed 's/ noclobber/ clobber/' | \
    p4 client -i
    
    0 讨论(0)
  • 2021-01-13 07:56

    It's pretty easy to script this with Perl, Python, Ruby, or even Powershell. Here's a one-liner in Powershell:

    p4 client -o | %{$_ -replace "noclobber", "clobber"} | p4 client -i

    0 讨论(0)
  • 2021-01-13 08:03

    Simplest solution:

    P4EDITOR='sed -i s/noclobber/clobber/' p4 client
    
    0 讨论(0)
提交回复
热议问题