umbraco / UmbPack

13 stars 13 forks source link

Override package filename #37

Closed mattbrailsford closed 4 years ago

mattbrailsford commented 4 years ago

Fixed #36 by introducing a -n flag to allow you to override the package file name generated by the pack command

umpack pack path/to/package.xml -v 1.0.0 -o output/directory -n MyPackage.1.0.0.zip
mattbrailsford commented 4 years ago

@jmayntzhusen any chance this could get merged in? I'd really like to start using UmbPack for my package generation but don't want my package naming strategy to change.

jmayntzhusen commented 4 years ago

I'll review this today 🙂

mattbrailsford commented 4 years ago

Ok, so I've now made GetPackageFileName do just what it's name says and it generates just the file name. I've then broken out the generation of the package output path to a line of code after the filename is generated. This ensures that it now works with both generated file names and explicitly supplied filenames.

In addition, I've also added an EnsureEndsWith extension method (taken from Umbraco core) to ensure that any explicitly supplied filename ends with ".zip".

I'm not taking into account the version as you can't be sure how this would be supplied and so I thinks it's enough to say "if you supply a name, you supply it all".

mattbrailsford commented 4 years ago

Awesome! Thank @jmayntzhusen for reviewing 🙏