On Wednesday, November 27, 2002, at 08:42  AM, Ray Zimmerman wrote:

I really like Mac CVS Pro, and have been using it under OS 9 and OS X as my CVS client. Now, as I'm moving more exclusively to OS X with it's command-line cvs, and with the release of BBEdit 7 with it's cvs integration, I'd really like to be able to use any of the 3 (Mac CVS Pro, command-line cvs, BBEdit cvs) on the same checked out source tree. The problem I found is that Mac CVS Pro (2.7d3) uses CR line endings in files inside its CVS directories (Entries, Repository, Root, etc) which doesn't work with the command-line cvs (and therefore BBEdit).
I think the problem is more than line feeds. The repository file gets written out as (this may be wrong since it is from memory) server:blahblahblah for an ssh type repository when the command line cvs expects :ext:blahblahblah.


BBEdit diff:

I want a bbdiff command-line program. Something that will let me type:

bbdiff file1 file2

or

bbdiff dir1 dir2

to initiate a file comparison or multi-file comparison in BBEdit. Ideally, Bare Bones would include something like this along side the bbedit command-line tool, but I was wondering if anyone has created (or could easily create) such a tool via a Perl script making some AppleScript calls or something?
I'm sure somebody has at some point. I just wrote one here. It isn't a full fledged tool in that it doesn't give you usage and doesn't have an error checking for arguments and such, but if you always supply both arguments and they are valid, it should do the job.

(Note that I am not a perl hacker, so there may be a more perlish way to do it.)

#!/usr/bin/perl

use warnings;
use strict;

use Cwd;

my $file1 = shift;
my $file2 = shift;

$file1 = cwd . "/" . $file1 if ($file1 !~ m|^/|);
$file2 = cwd . "/" . $file2 if ($file2 !~ m|^/|);

my $script = qq(
set f1 to posix file "$file1"
set f2 to posix file "$file2"
tell application "BBEdit"
activate
compare (f1 as alias) against (f2 as alias)
end tell
return ""
);

system("/usr/bin/osascript", "-e", $script);

Share and enjoy.

Jim



Reply via email to