Author Topic: Project Tools - path (no filename) %p and drive %v  (Read 3454 times)

bcernohous

  • Community Member
  • Posts: 12
  • Hero Points: 0
Project Tools - path (no filename) %p and drive %v
« on: February 08, 2007, 11:36:43 PM »
When I'm setting up my project build/etc tools, %p always includes the drive name (which seems odd since I could always use %v if I wanted the drive name).   For my environment, I need to supply my make/etc with:

/home/src/...

and not with

L:/home/src/...

Can I make %p do what I want?  Or do I need to write a macro (or modify HS2's macro in http://community.slickedit.com/index.php?topic=182.msg652#msg652)

(For anyone interested in why?, I want to use "plink ... make .. %p .." to remotely build on a linux box.  Linux doesn't understand my WinXP mapped L: drive is pointing to it's root.)

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Project Tools - path (no filename) %p and drive %v
« Reply #1 on: February 09, 2007, 12:45:59 PM »
I afraid '%p' can't take care about your share mappings and refers to the local project anyway.
I'd propose the following to solve it:
Use a 'Open Project' macro (see Proj. Props->Open-Tab / attachment) to setup the plink (remote) project dir as an env.var, which can be used instead '%p'.

Code: [Select]
_command void set_plinkdir ()
{
   _str pd=_ProjectGet_WorkingDir (_ProjectHandle (_project_name));

   if ( pd != '' )
   {
      pd=absolute (pd,strip_filename (_project_name,'N'));
      pd=strip_filename (pd,'D');

      // bslash -> slash
      pd = stranslate ( pd, "/", "\\", "" );

      // message ( "pd = " pd );
      set_env( "plinkdir",  pd );
   }
}

Your Build command can look like this: plink ... make .. %(plinkdir) ..

Hope it works for you,

HS2