Skip to content
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

Fix for compare sequence numbers and online help #1993

Merged
merged 9 commits into from
Jan 3, 2024
5 changes: 5 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to the Zowe CLI package will be documented in this file.

## Recent Changes

- BugFix: Correct extra character being displayed at the end of lines when issuing `zowe files compare` on Windows. [#1992](https://github.com/zowe/zowe-cli/issues/1992)
- BugFix: Correct the online help description for `zowe files compare uss`. [#1754](https://github.com/zowe/zowe-cli/issues/1754)

## `7.20.1`

- BugFix: Add missing npm-shrinkwrap
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/zosfiles/-strings-/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,8 +819,8 @@ export default {
}
},
USS_FILE: {
SUMMARY: "Compare content of a local file and a z/os uss files",
DESCRIPTION: "Compare the contents of a two uss files on your terminal (stdout). browser.",
SUMMARY: "Compare the contents of two z/os uss files",
DESCRIPTION: "Compare the contents of two uss files on your terminal (stdout). browser.",
POSITIONALS: {
USSFILEPATH1: "The path of the first uss file you want to compare.",
USSFILEPATH2: "The path of the second uss file you want to compare."
Expand Down
6 changes: 5 additions & 1 deletion packages/cli/src/zosfiles/compare/CompareBaseHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@
public prepareContent(content: string | Buffer): string {
let contentString = content.toString();
if(this.seqnum === false) {
const seqnumlen = 8;
let seqnumlen = 8;
/* If Windows, account for the carriage return */
if(process.platform === "win32" && content.toString().endsWith("\r\n")){
KevinLoesch1 marked this conversation as resolved.
Show resolved Hide resolved
seqnumlen = 9;

Check warning on line 170 in packages/cli/src/zosfiles/compare/CompareBaseHelper.ts

View workflow job for this annotation

GitHub Actions / lint

No magic number: 9

Check warning on line 170 in packages/cli/src/zosfiles/compare/CompareBaseHelper.ts

View check run for this annotation

Codecov / codecov/patch

packages/cli/src/zosfiles/compare/CompareBaseHelper.ts#L170

Added line #L170 was not covered by tests
}
contentString = content.toString().split("\n").map((line) => line.slice(0, -seqnumlen)).join("\n");
}
return contentString;
Expand Down