Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: directory specific functions and aliases



On Fri, Feb 13, 2015 at 4:41 PM, Peter Stephenson
<p.stephenson@xxxxxxxxxxx> wrote:
> On Fri, 13 Feb 2015 10:05:21 -0500
> shawn wilson <ag4ve.us@xxxxxxxxx> wrote:
>> What would be the best way to make functions that do different things
>> based on the directory I'm in - kinda like rvm does with rubies? I was
>> hoping for something cleaner than: case $(pwd) This is mainly because
>> I want to wrap cvs and rsync differently based on repo (and where
>> within that repo).
>
> I use a dot-file in the directory, but you need to be careful with this
> --- at least check you own the file before using it for extracting
> commands or anything of that kind.

I would check both the file and the containing directory; anyone can
create hardlinks to files you own in their own directories, and a
command that's safe in one directory may not be in another.

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author