Skip to content

Commit

Permalink
fix: plain view for --keep-archive option
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-bodnar committed Jun 1, 2023
1 parent 32d8778 commit 395c741
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,13 @@ private Pair<File, List<String>> download(BuildProjectTranslationRequest request
out.println(ERROR.withIcon(String.format(RESOURCE_BUNDLE.getString("error.deleting_archive"), downloadedZipArchive)));
}
} else {
out.println(OK.withIcon(String.format(RESOURCE_BUNDLE.getString("message.archive"), downloadedZipArchivePath)));
if (!plainView) {
out.println(OK.withIcon(String.format(RESOURCE_BUNDLE.getString("message.archive"), downloadedZipArchivePath)));
} else {
out.println(downloadedZipArchivePath);
}
}

return Pair.of(baseTempDir, downloadedFilesProc);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,24 @@ public void act(Outputter out, ProjectProperties pb, ClientBundle client) {
String baseTemp = StringUtils.removeEnd(pb.getBasePath(), Utils.PATH_SEPARATOR) + Utils.PATH_SEPARATOR;
java.io.File baseTempDir = new java.io.File(baseTemp + Utils.PATH_SEPARATOR);
List<java.io.File> downloadedFiles = extractArchive(to, baseTempDir);

for (File file: downloadedFiles) {
String filePath = Utils.noSepAtStart(StringUtils.removeStart(file.getAbsolutePath(), baseTempDir.getAbsolutePath()));
out.println(OK.withIcon(String.format(RESOURCE_BUNDLE.getString("message.extracted_file"), filePath)));
}

if (!keepArchive) {
try {
files.deleteFile(to);
} catch (IOException e) {
out.println(ERROR.withIcon(String.format(RESOURCE_BUNDLE.getString("error.deleting_archive"), to)));
}
} else {
out.println(OK.withIcon(String.format(RESOURCE_BUNDLE.getString("message.archive"), to.getAbsolutePath())));
if (!plainView) {
out.println(OK.withIcon(String.format(RESOURCE_BUNDLE.getString("message.archive"), to.getAbsolutePath())));
} else {
out.println(to.getAbsolutePath());
}
}
}

Expand Down

0 comments on commit 395c741

Please sign in to comment.