use execSync instead of exec

This commit is contained in:
ashley 2024-07-03 20:52:22 +00:00
parent 63ac519d60
commit 2a59d97d62

View file

@ -235,7 +235,7 @@ app.use("/sb/i/:v/:imagePath/:img", async function (req, res) {
const totalMemory = os.totalmem() / (1024 * 1024 * 1024); const totalMemory = os.totalmem() / (1024 * 1024 * 1024);
const roundedMemory = totalMemory.toFixed(2); const roundedMemory = totalMemory.toFixed(2);
exec('git rev-list HEAD -n 1 --abbrev-commit', (error, stdout, stderr) => { execSync('git rev-list HEAD -n 1 --abbrev-commit', (error, stdout, stderr) => {
if (error || stderr) { if (error || stderr) {
console.error(`Error executing command: ${error || stderr}`); console.error(`Error executing command: ${error || stderr}`);
return; return;