From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: directory specific functions and aliases
Date: Fri, 13 Feb 2015 23:17:42 +0100 [thread overview]
Message-ID: <CAHYJk3SRb7+0_JH0qXfqbCALuRuuGkaA3YrbBvoarWSc5zZ4BA@mail.gmail.com> (raw)
In-Reply-To: <20150213154138.118cf396@pwslap01u.europe.root.pri>
On Fri, Feb 13, 2015 at 4:41 PM, Peter Stephenson
<p.stephenson@samsung.com> wrote:
> On Fri, 13 Feb 2015 10:05:21 -0500
> shawn wilson <ag4ve.us@gmail.com> 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
prev parent reply other threads:[~2015-02-13 22:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-13 15:05 shawn wilson
2015-02-13 15:41 ` Peter Stephenson
2015-02-13 15:52 ` Peter Stephenson
2015-02-13 21:11 ` John Eikenberry
2015-02-13 22:17 ` Mikael Magnusson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHYJk3SRb7+0_JH0qXfqbCALuRuuGkaA3YrbBvoarWSc5zZ4BA@mail.gmail.com \
--to=mikachu@gmail.com \
--cc=p.stephenson@samsung.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).