Cornerstone 3 添加外部diff工具
时间:2025-11-04 00:12:19 出处:应用开发阅读(143)
因Mac上的加外具svn工具Cornerstone的diff工具十分不好用,并且比对不精确,加外具所以想在Cornerstone内调用第三方diff工具。加外具个人使用DiffFork进行比对。加外具

DiffFork还提供shell方式打开软件可以软链到/usr/local/bin/difffork


但是加外具我通过shell方式打开后是生成了2个比对窗口,2个文件没能在一起比对,WordPress模板加外具所以使用了applescript方式。加外具
但是加外具BeyondCompare可以通过shell方式正确打开,但是加外具Mac下的BeyondCompare对中文不友好所以就用DiffFork了。
shell调用方式:
#!/bin/bash original_path="$1" modified_path="$3" /usr/local/bin/bcompare "$original_path" "$modified_path"DiffFork提供的加外具applescript调用示例:
(* diff v: Diff diff item : the old item. against item : the new item. *) set theOld to (choose file with prompt "Select Old:") set theNew to (choose file with prompt "Select New:") tell application "DiffFork" activate diff theOld against theNew end tell因为Cornerstone的外部工具只支持*.sh的b2b供应网所以修改了DiffFork提供的applescript以shell方式打开。
#!/bin/bash osascript -e tell application "DiffFork" -e "activate" -e "diff \"$1\" against \"$3\"" -e end tell
下面是加外具BeyondCompare的调用方式:
#!/bin/bash original_path="$1" modified_path="$3" /usr/local/bin/bcompare "$original_path" "$modified_path"【本文是专栏作者张勇波的原创文章,转载请通过获取作者授权】
加外具
分享到:
温馨提示:以上内容和图片整理于网络,仅供参考,希望对您有帮助!如有侵权行为请联系删除!