Skip to content

Commit

Permalink
fix: do not use silent commands
Browse files Browse the repository at this point in the history
Signed-off-by: Ar Rakin <rakinar2@onesoftnet.eu.org>
  • Loading branch information
virtual-designer committed Sep 16, 2024
1 parent 971c7ae commit db598ec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
11 changes: 5 additions & 6 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35342,9 +35342,11 @@ class ChangeLogGenerator {
}
generateChangeLog(file_1) {
return __awaiter(this, arguments, void 0, function* (file, format = "plain") {
const { stdout } = yield (0, exec_1.getExecOutput)(process.argv0, ["/tmp/genchangelog", "-f", format], {
silent: true,
});
const { stdout } = yield (0, exec_1.getExecOutput)(process.argv0, [
"/tmp/genchangelog",
"-f",
format,
]);
yield (0, promises_1.writeFile)(file, stdout);
});
}
Expand Down Expand Up @@ -35429,7 +35431,6 @@ class GitClient {
return __awaiter(this, arguments, void 0, function* ({ args, exitCodeCheck = true }) {
const code = yield (0, exec_1.exec)(this.gitPath, args, {
ignoreReturnCode: !exitCodeCheck,
silent: true,
});
if (exitCodeCheck && code !== 0) {
throw new Error(`Failed to execute git command.`);
Expand All @@ -35440,7 +35441,6 @@ class GitClient {
return __awaiter(this, arguments, void 0, function* ({ args, exitCodeCheck = true }) {
const { stdout, exitCode } = yield (0, exec_1.getExecOutput)(this.gitPath, args, {
ignoreReturnCode: !exitCodeCheck,
silent: true,
});
if (exitCodeCheck && exitCode !== 0) {
throw new Error(`Failed to execute git command.`);
Expand Down Expand Up @@ -35605,7 +35605,6 @@ class GitClient {
let keyId;
const { stdout, stderr } = yield (0, exec_1.getExecOutput)("gpg", ["--import"], {
input: Buffer.from(key, "utf-8"),
silent: true,
});
for (const data of `${stdout}\n${stderr}`.split(/\r?\n/g)) {
const match = data.match(/^gpg: key ([0-9A-F]+):/);
Expand Down
12 changes: 5 additions & 7 deletions src/ChangeLogGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ class ChangeLogGenerator implements AsyncDisposable {
file: string,
format: "markdown" | "plain" = "plain",
) {
const { stdout } = await getExecOutput(
process.argv0,
["/tmp/genchangelog", "-f", format],
{
silent: true,
},
);
const { stdout } = await getExecOutput(process.argv0, [
"/tmp/genchangelog",
"-f",
format,
]);

await writeFile(file, stdout);
}
Expand Down
3 changes: 0 additions & 3 deletions src/GitClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class GitClient implements AsyncDisposable {
private async exec({ args, exitCodeCheck = true }: ExecOptions) {
const code = await exec(this.gitPath, args, {
ignoreReturnCode: !exitCodeCheck,
silent: true,
});

if (exitCodeCheck && code !== 0) {
Expand All @@ -44,7 +43,6 @@ class GitClient implements AsyncDisposable {
private async execWithOutput({ args, exitCodeCheck = true }: ExecOptions) {
const { stdout, exitCode } = await getExecOutput(this.gitPath, args, {
ignoreReturnCode: !exitCodeCheck,
silent: true,
});

if (exitCodeCheck && exitCode !== 0) {
Expand Down Expand Up @@ -219,7 +217,6 @@ class GitClient implements AsyncDisposable {

const { stdout, stderr } = await getExecOutput("gpg", ["--import"], {
input: Buffer.from(key, "utf-8"),
silent: true,
});

for (const data of `${stdout}\n${stderr}`.split(/\r?\n/g)) {
Expand Down

0 comments on commit db598ec

Please sign in to comment.