headcr4sh / node-maven

Maven for Node.js
Apache License 2.0
18 stars 14 forks source link

Format lost on dependency:tree command with outputFile parameter #15

Closed stauvel closed 5 years ago

stauvel commented 6 years ago

Hi !

I'm facing a strange behaviour with this code :

require('maven')
    .create({cwd: '/path/to/my/maven-project'})
    .execute(['dependency:tree'], { 'sort': true, outputFile: __dirname + '/dependencies.tree' });

The output format of tree (with +, - and \) is lost when I'm using an absolute path like ${__dirname}. For example :

 +- javax.mail:mail:jar:1.4:compile
|  \- javax.activation:activation:jar:1.1:compile

Will become :

javax.mail:mail:jar:1.4:compile
javax.activation:activation:jar:1.1:compile

Finally, I can do my job with theses workarounds and thank you for this usefull library for scripting my Maven migration. But I spent a lot of my poor brain on this strange behaviour and maybe you could explain me the difference between terminal command and nodeJs script?

headcr4sh commented 5 years ago

Should be fixed by the latest PR (#19)