"Ian Dexter R. Marquez" <[EMAIL PROTECTED]> writes:
> Hello, all:
>
> I've set up development and staging servers that will pull out the
> latest commits of web apps from the dev teams. However, I cannot get
> post-commit to work:
>
> <code>
>
> #!/bin/sh
>
> `which svn` update /path/to/webapp/docroot
> echo "Updated" | sendmail -t user
>
> </code>
This will never work:
- 'which svn' depends on svn actually being in the PATH; i.e. it is
useless to execute 'which svn' when svn isn't found in the PATH. To
quote from which(1):
which returns the pathnames of the files which would be executed
in the current environment, had its arguments been given as
commands in a strictly POSIX-conformant shell. It does this by
searching the PATH for executable files matching the names of the
arguments.
So, no, if svn isn't in the PATH, doing 'which svn' will NOT get its
location there. Might as well do this instead:
<code>
PATH=$PATH:/path/to/svn/bin
svn update /path/to/webapp/docroot
</code>
- Make sure that you return 0.
--
JM Ibanez
Senior Software Engineer
Orange & Bronze Software Labs, Ltd. Co.
[EMAIL PROTECTED]
http://software.orangeandbronze.com/
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph