chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -23,12 +23,17 @@ export async function runDaemonUninstall(opts: DaemonLifecycleOptions = {}) {
|
||||
notLoadedText: string;
|
||||
};
|
||||
}) => {
|
||||
if (!json) return;
|
||||
if (!json) {
|
||||
return;
|
||||
}
|
||||
emitDaemonActionJson({ action: "uninstall", ...payload });
|
||||
};
|
||||
const fail = (message: string) => {
|
||||
if (json) emit({ ok: false, error: message });
|
||||
else defaultRuntime.error(message);
|
||||
if (json) {
|
||||
emit({ ok: false, error: message });
|
||||
} else {
|
||||
defaultRuntime.error(message);
|
||||
}
|
||||
defaultRuntime.exit(1);
|
||||
};
|
||||
|
||||
@@ -91,12 +96,17 @@ export async function runDaemonStart(opts: DaemonLifecycleOptions = {}) {
|
||||
notLoadedText: string;
|
||||
};
|
||||
}) => {
|
||||
if (!json) return;
|
||||
if (!json) {
|
||||
return;
|
||||
}
|
||||
emitDaemonActionJson({ action: "start", ...payload });
|
||||
};
|
||||
const fail = (message: string, hints?: string[]) => {
|
||||
if (json) emit({ ok: false, error: message, hints });
|
||||
else defaultRuntime.error(message);
|
||||
if (json) {
|
||||
emit({ ok: false, error: message, hints });
|
||||
} else {
|
||||
defaultRuntime.error(message);
|
||||
}
|
||||
defaultRuntime.exit(1);
|
||||
};
|
||||
|
||||
@@ -167,12 +177,17 @@ export async function runDaemonStop(opts: DaemonLifecycleOptions = {}) {
|
||||
notLoadedText: string;
|
||||
};
|
||||
}) => {
|
||||
if (!json) return;
|
||||
if (!json) {
|
||||
return;
|
||||
}
|
||||
emitDaemonActionJson({ action: "stop", ...payload });
|
||||
};
|
||||
const fail = (message: string) => {
|
||||
if (json) emit({ ok: false, error: message });
|
||||
else defaultRuntime.error(message);
|
||||
if (json) {
|
||||
emit({ ok: false, error: message });
|
||||
} else {
|
||||
defaultRuntime.error(message);
|
||||
}
|
||||
defaultRuntime.exit(1);
|
||||
};
|
||||
|
||||
@@ -237,12 +252,17 @@ export async function runDaemonRestart(opts: DaemonLifecycleOptions = {}): Promi
|
||||
notLoadedText: string;
|
||||
};
|
||||
}) => {
|
||||
if (!json) return;
|
||||
if (!json) {
|
||||
return;
|
||||
}
|
||||
emitDaemonActionJson({ action: "restart", ...payload });
|
||||
};
|
||||
const fail = (message: string, hints?: string[]) => {
|
||||
if (json) emit({ ok: false, error: message, hints });
|
||||
else defaultRuntime.error(message);
|
||||
if (json) {
|
||||
emit({ ok: false, error: message, hints });
|
||||
} else {
|
||||
defaultRuntime.error(message);
|
||||
}
|
||||
defaultRuntime.exit(1);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user