SomeRanDev / reflaxe

Haxe framework for creating compilation targets using macros
MIT License
91 stars 4 forks source link

Fix SingleFile output #16

Closed fourst4r closed 7 months ago

fourst4r commented 7 months ago

This is what it was doing before: 1st compile: out/main.dart 2nd compile and beyond: out/out/main.dart

But should be working now.

SomeRanDev commented 7 months ago

I think this could be a bit cleaner, preferably ensureOutputDirExists should be a bit purer and not direcly check options.fileOutputType(?)

Could you give more detail to replicate this? What is output path being set to in the .hxml: out or out/main.dart? Okay this is definitely messed up. Lemme see if I can find a nicer way to fix this...

SomeRanDev commented 7 months ago

Okay, this (e9de25fe8e3d306b2a2988c44a830c9454d1593e) should fix this. In Reflaxe, I would like it so that no file extension = directory, so:

out=thing.ext -> thing.ext
out=thing     -> thing/defaultFileName.ext
fourst4r commented 7 months ago

Sure, although directories are allowed to contain dots (at least on Windows), so technically there's no way to know for sure if the user means a dir or a file.

SomeRanDev commented 7 months ago

Ohhh that is a good point. I'll add another line that checks if the input is an existing directory 👌 Also guess it's about time I add some proper tests to this repo. 😅