You are not logged in.

#1 2008-01-08 20:17:54

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

Bash Subversion question

I've just put my whole home folder into a subversion repo (actually two), so almost whenver I'm doing something, it's inside a working copy. Is there some way to set up Bash so that when I'm in those working directories, it aliases the normal file commands (mv cp etc) to their svn counterparts? But when I'm not in a working copy, it automatically reverts back to the normal commands?


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

#2 2008-01-08 20:24:56

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Bash Subversion question

You'd probably want to craft some functions - something like:

function cp-svn-version()
{
    if [ "$(pwd | cut -d'/' -f1-2)" = "/home/myusername" ]; then
        svn cp $@
    else
        cp $@
    fi
}

Then do alias cp="cp-svn-version", and so on.

Offline

Board footer

Powered by FluxBB