Skip to content

Commit f62278d

Browse files
feat: add warning when ignore tcc db updates
1 parent fa3066b commit f62278d

File tree

4 files changed

+12
-20
lines changed

4 files changed

+12
-20
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ npx @guidepup/setup --ignore-tcc-db
6060
```
6161

6262
> [!NOTE]
63-
> If the necessary permissions have not been granted by other means, using this flag may result in your environment not being setup for reliable screen reader automation.
63+
> If the necessary permissions have not been granted by other means, using this flag may result in your environment not being set up for reliable screen reader automation.
6464

6565
#### Recording
6666

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@guidepup/setup",
3-
"version": "0.15.0",
3+
"version": "0.15.1",
44
"description": "Setup your environment for screen-reader automation.",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",

src/logging.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,12 @@ export function handleComplete(): never {
1212
process.exit(0);
1313
}
1414

15-
export function handleWarning(err: Error): void {
16-
let message = err.message;
17-
18-
if (err.name) {
19-
message = `${err.name}: ${message}`;
20-
}
21-
22-
logWarn("");
23-
logWarn(chalk.bold(chalk.yellow(`[!] ${chalk.bold(message.toString())}`)));
15+
export function handleWarning(title: string, subtitle: string): void {
2416
logWarn("");
25-
logWarn("Unable to complete environment setup");
26-
logWarn("");
27-
logWarn(
28-
chalk.dim(
29-
"Please raise new issues at: " +
30-
chalk.underline("https://github.com/guidepup/setup/issues")
31-
)
32-
);
17+
logWarn(chalk.bold(chalk.yellow(`[!] Warning: ${chalk.bold(title)}`)));
3318
logWarn("");
19+
logWarn(subtitle);
20+
logError("");
3421
}
3522

3623
export function handleError(err: Error): never {

src/macOS/setup.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { SYSTEM_PATH, USER_PATH, updateTccDb } from "./updateTccDb";
1010
import { isAppleScriptControlEnabled } from "./isAppleScriptControlEnabled";
1111
import { askUserToControlUi } from "./askUserToControlUi";
1212
import { setVoiceOverEnabledViaUi } from "./setVoiceOverEnabledViaUi";
13-
import { logInfo } from "../logging";
13+
import { handleWarning, logInfo } from "../logging";
1414
import { ERR_MACOS_REQUIRES_MANUAL_USER_INTERACTION } from "../errors";
1515
import { enableDoNotDisturb } from "./enableDoNotDisturb";
1616
import { enabledDbFile } from "./isAppleScriptControlEnabled/enabledDbFile";
@@ -34,6 +34,11 @@ export async function setup(): Promise<void> {
3434
} catch {
3535
// Swallow error - most CI don't allow system configuration
3636
}
37+
} else {
38+
handleWarning(
39+
"Ignoring TCC.db updates",
40+
"If the necessary permissions have not been granted by other means, using this flag may result in your environment not being set up for reliable screen reader automation."
41+
);
3742
}
3843

3944
const osName = platform();

0 commit comments

Comments
 (0)