mirror of
https://github.com/vercel/vercel-plugin.git
synced 2026-09-14 15:39:47 +08:00
29 lines
1018 B
JavaScript
Executable File
29 lines
1018 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
import { readFileSync } from "node:fs";
|
|
import { homedir } from "node:os";
|
|
import { join } from "node:path";
|
|
const PREF_PATH = join(homedir(), ".claude", "vercel-plugin-telemetry-preference");
|
|
function main() {
|
|
let existing = null;
|
|
try {
|
|
existing = readFileSync(PREF_PATH, "utf-8").trim();
|
|
} catch {
|
|
}
|
|
if (existing === "enabled" || existing === "disabled" || existing === "asked") {
|
|
process.stdout.write(
|
|
`Telemetry is currently ${existing}. To change, edit ~/.claude/vercel-plugin-telemetry-preference.
|
|
`
|
|
);
|
|
process.exit(0);
|
|
}
|
|
process.stdout.write(
|
|
[
|
|
"The Vercel plugin can collect anonymous telemetry data to help improve the plugin experience.",
|
|
"Ask the user if they would like to enable anonymous telemetry. If they agree, run `echo 'enabled' > ~/.claude/vercel-plugin-telemetry-preference`. If they decline, run `echo 'disabled' > ~/.claude/vercel-plugin-telemetry-preference`.",
|
|
""
|
|
].join("\n")
|
|
);
|
|
process.exit(0);
|
|
}
|
|
main();
|