Skip to content

Commit

Permalink
New version 05 (#135)
Browse files Browse the repository at this point in the history
* Bumped to version 4.3.0

* Bumped to version 4.3.0

Co-authored-by: fr43nk <frank@seito.de>
  • Loading branch information
fr43nk and fr43nk authored Jan 27, 2023
1 parent baf5d46 commit d93d011
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions src/clearcase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,12 @@ export class ClearCase {
new CCArgs(["ls"], [docs[0]?.fsPath]),
dirname(docs[0]?.fsPath),
null,
() => func(docs),
(error: string) => {
this.outputChannel.appendLine(`clearcase, exec error: ${error}`);
window.showErrorMessage(`${docs[0]?.fsPath} is not a valid ClearCase object.`);
(code: number, _output: string, error: string) => {
if (code !== 0 || error.length > 0) {
window.showErrorMessage(`${docs[0]?.fsPath} is not a valid ClearCase object.`);
} else {
func(docs);
}
}
);
}
Expand Down Expand Up @@ -668,8 +670,10 @@ export class ClearCase {
new CCArgs(["update"], [updateFsObj]),
cwd,
() => this.mUpdateEvent.fire([filePath]),
(result: string) => (resultOut = result),
(error: string) => (errorRes = error)
(_code: number, output: string, error: string) => {
errorRes = error;
resultOut = output;
}
);
if (errorRes.length > 0) {
throw new Error(errorRes);
Expand Down Expand Up @@ -919,19 +923,16 @@ export class ClearCase {
});

command.on("close", (code) => {
if (code !== 0) {
outputChannel.appendLine(cmdErrMsg);
if (isView && cmdErrMsg !== "") {
window.showErrorMessage(`${cmdErrMsg}`, { modal: false });
reject(cmdErrMsg);
}
if (typeof onFinished === "function") {
onFinished("error");
}
} else {
if (typeof onFinished === "function") {
onFinished(allData.length > 0 ? allData.toString() : allDataStr);
}
if (cmdErrMsg !== "") {
// If something was printed on stderr, log it, regardless of the exit code
outputChannel.appendLine(`exit code ${code}, stderr: ${cmdErrMsg}`);
}
if (code !== 0 && isView && cmdErrMsg !== "") {
window.showErrorMessage(`${cmdErrMsg}`, { modal: false });
reject(cmdErrMsg);
}
if (typeof onFinished === "function") {
onFinished(code, allData.length > 0 ? allData.toString() : allDataStr, cmdErrMsg);
}
resolve();
});
Expand Down

0 comments on commit d93d011

Please sign in to comment.