Skip to content

Commit 9ae54d8

Browse files
author
Amelia Wattenbeger
committed
update exec statement
1 parent 9a4077f commit 9ae54d8

File tree

2 files changed

+3
-45
lines changed

2 files changed

+3
-45
lines changed

index.js

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15078,7 +15078,7 @@ var main = async () => {
1507815078
const outputFile = core.getInput("output_file") || "./diagram.svg";
1507915079
await import_fs2.default.writeFileSync(outputFile, componentCodeString);
1508015080
await (0, import_exec.exec)("git", ["add", outputFile]);
15081-
const diff = await execWithOutput("git", ["diff", outputFile]);
15081+
const diff = await (0, import_exec.exec)("git", ["diff", outputFile]);
1508215082
core.info(`diff: ${diff}`);
1508315083
if (!diff) {
1508415084
core.info("[INFO] No changes to the repo detected, exiting");
@@ -15089,26 +15089,6 @@ var main = async () => {
1508915089
console.log("All set!");
1509015090
};
1509115091
main();
15092-
function execWithOutput(command, args) {
15093-
return new Promise(function(resolve, reject) {
15094-
try {
15095-
(0, import_exec.exec)(command, args, {
15096-
listeners: {
15097-
stdout: function(res) {
15098-
core.info(res.toString());
15099-
resolve(res.toString());
15100-
},
15101-
stderr: function(res) {
15102-
core.info(res.toString());
15103-
reject(res.toString());
15104-
}
15105-
}
15106-
});
15107-
} catch (e) {
15108-
reject(e);
15109-
}
15110-
});
15111-
}
1511215092
/*
1511315093
object-assign
1511415094
(c) Sindre Sorhus

src/index.jsx

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const main = async () => {
3030
await fs.writeFileSync(outputFile, componentCodeString)
3131

3232
await exec('git', ['add', outputFile])
33-
const diff = await execWithOutput('git', ['diff', outputFile])
33+
const diff = await exec('git', ['diff', outputFile])
3434
core.info(`diff: ${diff}`)
3535
if (!diff) {
3636
core.info('[INFO] No changes to the repo detected, exiting')
@@ -43,26 +43,4 @@ const main = async () => {
4343
console.log("All set!")
4444
}
4545

46-
main()
47-
48-
function execWithOutput(command, args) {
49-
return new Promise(function (resolve, reject) {
50-
try {
51-
exec(command, args, {
52-
listeners: {
53-
stdout: function (res) {
54-
core.info(res.toString())
55-
resolve(res.toString())
56-
},
57-
stderr: function (res) {
58-
core.info(res.toString())
59-
reject(res.toString())
60-
}
61-
}
62-
})
63-
} catch (e) {
64-
reject(e)
65-
}
66-
})
67-
}
68-
46+
main()

0 commit comments

Comments
 (0)