From e31417c5bfcda7cf3f35cf26b5fe1a237dc71433 Mon Sep 17 00:00:00 2001 From: Nawaz Dhandala Date: Thu, 6 Nov 2025 19:41:57 +0000 Subject: [PATCH] style(exec, nginx, docs): tidy formatting and indentation across Execute.ts, NginxConfigurator.ts, and Telemetry Documentation --- Common/Server/Utils/Execute.ts | 54 ++++++++++--------- .../Components/Telemetry/Documentation.tsx | 2 - Nginx/Utils/NginxConfigurator.ts | 16 +++--- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Common/Server/Utils/Execute.ts b/Common/Server/Utils/Execute.ts index 5aea454b3d..835d461b26 100644 --- a/Common/Server/Utils/Execute.ts +++ b/Common/Server/Utils/Execute.ts @@ -93,35 +93,37 @@ export default class Execute { args?: Array; options?: SpawnOptions; }): Promise { - return new Promise((resolve: VoidFunction, reject: PromiseRejectErrorFunction) => { - const spawnOptions: SpawnOptions = { - stdio: ["ignore", "inherit", "inherit"], - shell: false, - ...data.options, - }; + return new Promise( + (resolve: VoidFunction, reject: PromiseRejectErrorFunction) => { + const spawnOptions: SpawnOptions = { + stdio: ["ignore", "inherit", "inherit"], + shell: false, + ...data.options, + }; - const child = spawn(data.command, data.args ?? [], spawnOptions); + const child = spawn(data.command, data.args ?? [], spawnOptions); - child.on("error", (err: Error) => { - logger.error( - `Error executing command: ${data.command} ${(data.args ?? []).join(" ")}`, - ); - logger.error(err); - reject(err); - }); + child.on("error", (err: Error) => { + logger.error( + `Error executing command: ${data.command} ${(data.args ?? []).join(" ")}`, + ); + logger.error(err); + reject(err); + }); - child.on("close", (code: number | null) => { - if (code === 0) { - resolve(); - return; - } + child.on("close", (code: number | null) => { + if (code === 0) { + resolve(); + return; + } - const error: Error = new Error( - `Command failed: ${data.command} ${(data.args ?? []).join(" ")} (exit code ${code ?? "unknown"})`, - ); - logger.error(error); - reject(error); - }); - }); + const error: Error = new Error( + `Command failed: ${data.command} ${(data.args ?? []).join(" ")} (exit code ${code ?? "unknown"})`, + ); + logger.error(error); + reject(error); + }); + }, + ); } } diff --git a/Dashboard/src/Components/Telemetry/Documentation.tsx b/Dashboard/src/Components/Telemetry/Documentation.tsx index 0ab85017da..81c6598942 100644 --- a/Dashboard/src/Components/Telemetry/Documentation.tsx +++ b/Dashboard/src/Components/Telemetry/Documentation.tsx @@ -36,8 +36,6 @@ const TelemetryDocumentation: FunctionComponent = (): ReactElement => { "Learn how to integrate OneUptime with your application or resources to collect logs, metrics and traces data." } > - - { try { await LocalFile.makeDirectory(this.NGINX_LOG_DIRECTORY); - const accessLogExists: boolean = - await LocalFile.doesFileExist(this.NGINX_ACCESS_LOG_PATH); + const accessLogExists: boolean = await LocalFile.doesFileExist( + this.NGINX_ACCESS_LOG_PATH, + ); if (!accessLogExists) { await LocalFile.write(this.NGINX_ACCESS_LOG_PATH, ""); } - const errorLogExists: boolean = - await LocalFile.doesFileExist(this.NGINX_ERROR_LOG_PATH); + const errorLogExists: boolean = await LocalFile.doesFileExist( + this.NGINX_ERROR_LOG_PATH, + ); if (!errorLogExists) { await LocalFile.write(this.NGINX_ERROR_LOG_PATH, "");