Skip to content

Commit 470c169

Browse files
committed
Fix lint
1 parent 6b00b3a commit 470c169

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

lib/cli/main.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async function main(inputArgs: string[]) {
2323
try {
2424
args = parseArguments(inputArgs);
2525
} catch (e) {
26-
console.error(e.message);
26+
console.error((e as Error).message);
2727
exit(1);
2828
return;
2929
}
@@ -43,7 +43,7 @@ async function main(inputArgs: string[]) {
4343
try {
4444
args = checkArguments(args);
4545
} catch (e) {
46-
console.error(e.message);
46+
console.error((e as Error).message);
4747
exit(1);
4848
return;
4949
}
@@ -82,7 +82,7 @@ async function main(inputArgs: string[]) {
8282
}
8383
exit(0);
8484
} catch (e) {
85-
console.error(`Could not install service, error: ${e.message}`);
85+
console.error(`Could not install service, error: ${(e as Error).message}`);
8686
exit(1);
8787
}
8888
/**
@@ -104,7 +104,7 @@ async function main(inputArgs: string[]) {
104104
}
105105
exit(0);
106106
} catch (e) {
107-
console.error(`Could not uninstall service, error: ${e.message}`);
107+
console.error(`Could not uninstall service, error: ${(e as Error).message}`);
108108
exit(1);
109109
}
110110
} else {

lib/managers/launchd.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class LaunchdService {
130130
try {
131131
await unlink(plistPath);
132132
} catch (error) {
133-
throw new Error(`Failed to rollback changes: Could not remove '${plistPath}'. Error: ${error.message}`);
133+
throw new Error(`Failed to rollback changes: Could not remove '${plistPath}'. Error: ${(error as Error).message}`);
134134
}
135135
}
136136

@@ -174,7 +174,7 @@ class LaunchdService {
174174
manualSteps,
175175
};
176176
} catch (error) {
177-
throw new Error(`Failed to uninstall service: Could not remove '${plistPath}'. Error:`, error.message);
177+
throw new Error(`Failed to uninstall service: Could not remove '${plistPath}'. Error:`, error as Error);
178178
}
179179
}
180180
}

lib/managers/systemd.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class SystemdService {
187187
manualSteps: manualSteps,
188188
};
189189
} catch (error) {
190-
throw new Error(`Failed to uninstall service: Could not remove '${servicePath}'. Error: '${error.message}'`);
190+
throw new Error(`Failed to uninstall service: Could not remove '${servicePath}'. Error: '${(error as Error).message}'`);
191191
}
192192
}
193193

@@ -246,7 +246,7 @@ class SystemdService {
246246
throw new Error("Failed to reload daemon while rolling back.");
247247
}
248248
} catch (error) {
249-
throw new Error(`Failed to rollback changes: Could not remove '${servicePath}'. Error: '${error.message}'`);
249+
throw new Error(`Failed to rollback changes: Could not remove '${servicePath}'. Error: '${(error as Error).message}'`);
250250
}
251251
}
252252
}

lib/managers/upstart.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class UpstartService {
145145
};
146146
} catch (error) {
147147
throw new Error(
148-
`Failed to uninstall service: Could not remove '${upstartFilePath}'. Error: '${error.message}`,
148+
`Failed to uninstall service: Could not remove '${upstartFilePath}'. Error: '${(error as Error).message}`,
149149
);
150150
}
151151
}

lib/managers/windows.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class WindowsService {
119119
manualSteps: null,
120120
};
121121
} catch (error) {
122-
throw new Error(`Failed to uninstall service: Could not remove '${serviceBatchPath}'. Error: '${error.message}'`);
122+
throw new Error(`Failed to uninstall service: Could not remove '${serviceBatchPath}'. Error: '${(error as Error).message}'`);
123123
}
124124
}
125125

@@ -166,7 +166,7 @@ class WindowsService {
166166
try {
167167
await unlink(serviceBatchPath);
168168
} catch (error) {
169-
console.error(`Failed to rollback changes: Could not remove '${serviceBatchPath}'. Error:`, error.message);
169+
console.error(`Failed to rollback changes: Could not remove '${serviceBatchPath}'. Error:`, (error as Error).message);
170170
}
171171
}
172172
}

lib/service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ async function detectInitSystem(): Promise<string> {
187187
let process: SpawnResult | undefined;
188188
try {
189189
process = await spawn(["ps", "-p", "1", "-o", "comm="]);
190-
} catch (e) {
191-
throw new Error(`Unexpected error while determining init system: ${e.message}`);
190+
} catch (e: unknown) {
191+
throw new Error(`Unexpected error while determining init system: ${(e as Error).message}`);
192192
}
193193

194194
if (process.code !== 0) {

0 commit comments

Comments
 (0)