Keep the original directory architecture in output

0 votes
asked Jul 31 in Question / help by Matt
Hi !

I'm struggling to structure the output while using the command lines.

Let say I put all my pull files in a folder name "source", which has several subfolders.

From the documentation I get that :

- if absolute path is used to target the output : it recursively finds and converts all files in the source folder and its subfolders, BUT the generated output are all at the root of the output directory. The directory hierarchy is lost in the output directory.

- if the path is relative, then, an output folder is created in each subfolder from the source.

What I'd like to get is a unique output directory keeping the original directory hierarchy from the source. How do you think I can achieve this ?

Thanks in advance for any advice.

Cheers,

Matt

1 Answer

0 votes
answered Jul 31 by plantuml (208,860 points)

Maybe we can add some switch option to change behaviour.

But I think that you can use :

java -jar plantuml.jar -o "../../myDestination" "source"

commented Aug 1 by Matt
Can you tell me what you call a switch option ?

I've tried you command but unfortunately this doesn't do what I'd like.

But I should have shared my command lines as you did, so here they are :

In my folder I have:

output        plantuml.jar    source

So when I run

java -jar plantuml.jar "./source/**" -o "./output" -tsvg

it creates one output folder for each subfolder in "source"

And when I run

java -jar plantuml.jar "./source/**" -o "/absolute path to output" -tsvg

It fills the output folder with all the diagrams, without keeping the subfolders.

What I would like to have: all the diagrams in the same output folder, keeping the subfolder hierarchy.

Cheers !
commented Aug 1 by plantuml (208,860 points)

We've made a new beta http://beta.plantuml.net/plantuml.jar.

With this beta you can have :

java -jar plantuml.jar "./source/**" -o "./outputRel/$"

The final $ is a magic value that is replaced by the initial directory name.

  1. This is really a beta version. Testing this is quite complicated so we are counting on you to find bugs :-)
  2. We do not like this "$" magic value so if someone has a better idea for syntax, please do some suggestions !
In this example, the "source" name will be replicated into "outputRel" directory which is not exactly what you want. So you may also use:
cd source; java -jar plantuml.jar "./**" -o "../output/$"

commented Aug 2 by Matt
Thank you sooo much !! :)

This works perfectly for me ! I tested with a few diagrams only. I'll continue to use the beta and let you know if I find any bug.

Let me know if I can do something to help.
...