mirror of
https://github.com/Xevion/dotfiles.git
synced 2025-12-14 18:11:34 -06:00
feat: major dotfiles refactor with documentation and multi-platform improvements
- Add comprehensive CLAUDE.md with chezmoi best practices and AI assistant guidelines - Restructure TODO.md with prioritized tasks and detailed organization - Add PowerShell profile template for Windows platform support - Split git configs into identity-specific templates (ryan/xevion) - Convert nushell env.nu and gitconfig to templates for cross-platform rendering - Refactor chezmoi hooks to TypeScript (.init_pre.ts, .update_pre.ts) - Update .chezmoiignore with better platform-specific file handling - Remove deprecated shellchecker.sh and tasks.json from VS Code config - Add mise integration to shell configs (bash, zsh, nushell, PowerShell) - Clean up commonrc.sh.tmpl WSL-specific code - Disable Deno in VS Code settings, enable simple dialog mode - Add nushell extension recommendation to VS Code This commit establishes better cross-platform support (Windows/WSL/Linux), improves documentation for future maintenance, and standardizes configuration management patterns across the repository.
This commit is contained in:
@@ -1,28 +1,27 @@
|
||||
#!/usr/bin/env -S deno run -A
|
||||
#!/usr/bin/env bun
|
||||
console.log("init_pre.ts");
|
||||
|
||||
import { resolve } from "https://deno.land/std/path/mod.ts";
|
||||
import { exists } from "jsr:@std/fs";
|
||||
import { exists } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { $, os } from "npm:zx@8.3.2";
|
||||
import { homedir } from "node:os";
|
||||
import { $ } from "bun";
|
||||
|
||||
const { exit } = Deno;
|
||||
const filePath = join(os.homedir(), "key.txt");
|
||||
const filePath = join(homedir(), "key.txt");
|
||||
|
||||
|
||||
if (await exists(resolve(filePath))) {
|
||||
if (await exists(filePath)) {
|
||||
console.log("key.txt already exists");
|
||||
Deno.exit(0);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
// Acquire the secret from Doppler
|
||||
const result = await $`doppler secrets get KEY_TXT --plain`;
|
||||
const result = await $`doppler secrets get KEY_TXT --plain`.quiet();
|
||||
|
||||
// Check if the command was successful
|
||||
if (result.exitCode !== 0) {
|
||||
console.error("Failed to get secret KEY_TXT");
|
||||
exit(1);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Write the secret to a file
|
||||
await Deno.writeTextFile(resolve(filePath), result.stdout);
|
||||
await Bun.write(filePath, result.stdout);
|
||||
console.log("key.txt bootstrapped");
|
||||
|
||||
Reference in New Issue
Block a user