Skip to content

Commit 5e60e82

Browse files
committed
going sync
1 parent 70e17c0 commit 5e60e82

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

github.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ const {
99
checkIfBranchExists,
1010
} = require("./index");
1111

12+
1213
const commitCommand = "commit";
1314
const branchCommand = "branch"
1415

1516
const appendLineToFile = (filename, line) => {
16-
fs.appendFile(filename, `${line}\n`, function (err) {
17-
if (err) throw err;
18-
console.log(`Saved data to ${filename}.`);
19-
});
17+
try {
18+
fs.appendFileSync(filename, `${line}\n`);
19+
} catch (e) {
20+
console.error(`Error appending line to file ${filename}: ${e.message}`);
21+
throw e;
22+
}
2023
};
2124

2225
const writeResultToGithubOutputFile = (results) => {

0 commit comments

Comments
 (0)