Re: in rule - absolute path
Bram Moolenaar <[email protected]> Sat, 17 Dec 2005 16:24:03 +0100
| Newsgroups | gmane.comp.tools.aap.user |
|---|---|
| Message-ID | <[email protected]> |
Calmar wrote:
> when I have a rule like that
>=20
> :rule %.html : htmlbegin.part=20
> %.part=20
>=20
> and when the files to build include some paths:
>=20
> files =3D file1
> dir1/dir2/file2
>=20
> it seems aap looks for some dir1/dir2/htmlbegin.part file, so in
> the same dir where file2 is in.
>=20
> I would like to use always the same htmlbegin.part file, so I
> would need to put there a absolute path like:
>=20
> :rule %.html : /var/www/oldtimer/htmlbegin.part
> %.part
>=20
> That seems to work, but it's probably not really a really good
> way to do it.
>=20
> Is there a simple aap variable representing the path where the
> main.aap script is actually in or so? Or how would I do that in
> a good way?
I don't think we have a variable for that. You can use this:
cwd =3D `os.getcwd()`
:rule %.html : $cwd/htmlbegin.part %.part=20
A recipe is always interpreted with the current directory set to that of
the recipe, thus this should work.
--=20
ARTHUR: No, hang on! Just answer the five questions ...
GALAHAD: Three questions ...
ARTHUR: Three questions ... And we shall watch ... and pray.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURE=
S LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \=
\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ =
\\\
\\\ download, build and distribute -- http://www.A-A-P.org =
///
\\\ help me help AIDS victims -- http://www.ICCF.nl /=
//
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick