I have a config file with a target directory path. At upgrade the path should be used to specify where a certain folder should be unpacked. The path may be relative installdir or absolute. Now I need to use the path to set the correct destination of the folder. If it is relative, I should append it to installdir, if it is absolute I should use it as is:

Examples of configurated paths and the corresponding desired result:

  • relative/path - ${installdir}/relative/path
  • ../above - ${installdir}/../above
  • /absolute/path - /absolute/path
  • D:\data - D:\data

How do I code this?

asked 24 Jul '13, 05:53

perfry's gravatar image

perfry
31449
accept rate: 0%

edited 24 Jul '13, 05:55


You could the below code:

<cd path="${installdir}"/>
<pathManipulation path="${path_from_file}" variable="normalized_path_from_file"/>
link

answered 28 Jul '13, 18:04

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Works perfect! The "cd" action was what I was missing.

(30 Jul '13, 09:26) perfry
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×33
×3

Asked: 24 Jul '13, 05:53

Seen: 1,161 times

Last updated: 30 Jul '13, 09:26