-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable to chose file type : .zip or .tar or .tar.gz #8
base: master
Are you sure you want to change the base?
Conversation
File zipFile = File.createTempFile(projectName + "-", ".zip"); | ||
String extension; | ||
BundleType bundleType; | ||
if (fileType == null || fileType.equals("Tar")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fileType.equals("Zip")
} else if (fileType.equals("Tgz")) { | ||
extension = ".tar.gz"; | ||
bundleType = BundleType.Tgz; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather we throw on an unknown file type since you're already handling the default null case (maybe update it to include empty string too)
|
||
sourceDirectory.zip( | ||
new FileOutputStream(zipFile), | ||
if (fileType == null || fileType.equals("Zip")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might change this to switch based on bundleType since you set it earlier into 1 of the 3 categories (avoids having to have the fallback / null check here)
Hi! Thanks for the contribution. Did you perform any testing as part of the changes? If so it'd be helpful to include that in the PR. Are you OK with submitting this contribution under the Apache License 2.0? |
Hello,
this add a parameter to chose file type for the package (zip / tar / tar.gz)