@heyitsiveen/dotfiles 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/index.mjs +115 -85
  2. package/dotfiles/macos/.config/fish/completions/fisher.fish +7 -0
  3. package/dotfiles/macos/.config/fish/completions/tide.fish +13 -0
  4. package/dotfiles/macos/.config/fish/conf.d/_tide_init.fish +44 -0
  5. package/dotfiles/macos/.config/fish/fish_plugins +2 -0
  6. package/dotfiles/macos/.config/fish/functions/_tide_1_line_prompt.fish +19 -0
  7. package/dotfiles/macos/.config/fish/functions/_tide_2_line_prompt.fish +31 -0
  8. package/dotfiles/macos/.config/fish/functions/_tide_cache_variables.fish +17 -0
  9. package/dotfiles/macos/.config/fish/functions/_tide_detect_os.fish +76 -0
  10. package/dotfiles/macos/.config/fish/functions/_tide_find_and_remove.fish +3 -0
  11. package/dotfiles/macos/.config/fish/functions/_tide_fish_colorize.fish +7 -0
  12. package/dotfiles/macos/.config/fish/functions/_tide_item_aws.fish +11 -0
  13. package/dotfiles/macos/.config/fish/functions/_tide_item_bun.fish +6 -0
  14. package/dotfiles/macos/.config/fish/functions/_tide_item_character.fish +17 -0
  15. package/dotfiles/macos/.config/fish/functions/_tide_item_cmd_duration.fish +12 -0
  16. package/dotfiles/macos/.config/fish/functions/_tide_item_context.fish +14 -0
  17. package/dotfiles/macos/.config/fish/functions/_tide_item_crystal.fish +6 -0
  18. package/dotfiles/macos/.config/fish/functions/_tide_item_direnv.fish +7 -0
  19. package/dotfiles/macos/.config/fish/functions/_tide_item_distrobox.fish +4 -0
  20. package/dotfiles/macos/.config/fish/functions/_tide_item_docker.fish +5 -0
  21. package/dotfiles/macos/.config/fish/functions/_tide_item_elixir.fish +4 -0
  22. package/dotfiles/macos/.config/fish/functions/_tide_item_gcloud.fish +8 -0
  23. package/dotfiles/macos/.config/fish/functions/_tide_item_git.fish +72 -0
  24. package/dotfiles/macos/.config/fish/functions/_tide_item_go.fish +6 -0
  25. package/dotfiles/macos/.config/fish/functions/_tide_item_java.fish +6 -0
  26. package/dotfiles/macos/.config/fish/functions/_tide_item_jobs.fish +7 -0
  27. package/dotfiles/macos/.config/fish/functions/_tide_item_kubectl.fish +4 -0
  28. package/dotfiles/macos/.config/fish/functions/_tide_item_nix_shell.fish +3 -0
  29. package/dotfiles/macos/.config/fish/functions/_tide_item_node.fish +6 -0
  30. package/dotfiles/macos/.config/fish/functions/_tide_item_os.fish +3 -0
  31. package/dotfiles/macos/.config/fish/functions/_tide_item_php.fish +6 -0
  32. package/dotfiles/macos/.config/fish/functions/_tide_item_private_mode.fish +3 -0
  33. package/dotfiles/macos/.config/fish/functions/_tide_item_pulumi.fish +19 -0
  34. package/dotfiles/macos/.config/fish/functions/_tide_item_python.fish +27 -0
  35. package/dotfiles/macos/.config/fish/functions/_tide_item_ruby.fish +6 -0
  36. package/dotfiles/macos/.config/fish/functions/_tide_item_rustc.fish +6 -0
  37. package/dotfiles/macos/.config/fish/functions/_tide_item_shlvl.fish +4 -0
  38. package/dotfiles/macos/.config/fish/functions/_tide_item_status.fish +15 -0
  39. package/dotfiles/macos/.config/fish/functions/_tide_item_terraform.fish +5 -0
  40. package/dotfiles/macos/.config/fish/functions/_tide_item_time.fish +3 -0
  41. package/dotfiles/macos/.config/fish/functions/_tide_item_toolbox.fish +4 -0
  42. package/dotfiles/macos/.config/fish/functions/_tide_item_vi_mode.fish +16 -0
  43. package/dotfiles/macos/.config/fish/functions/_tide_item_zig.fish +6 -0
  44. package/dotfiles/macos/.config/fish/functions/_tide_parent_dirs.fish +10 -0
  45. package/dotfiles/macos/.config/fish/functions/_tide_print_item.fish +22 -0
  46. package/dotfiles/macos/.config/fish/functions/_tide_pwd.fish +42 -0
  47. package/dotfiles/macos/.config/fish/functions/_tide_remove_unusable_items.fish +25 -0
  48. package/dotfiles/macos/.config/fish/functions/_tide_sub_bug-report.fish +73 -0
  49. package/dotfiles/macos/.config/fish/functions/_tide_sub_configure.fish +156 -0
  50. package/dotfiles/macos/.config/fish/functions/_tide_sub_reload.fish +3 -0
  51. package/dotfiles/macos/.config/fish/functions/fish_mode_prompt.fish +1 -0
  52. package/dotfiles/macos/.config/fish/functions/fish_prompt.fish +170 -0
  53. package/dotfiles/macos/.config/fish/functions/fisher.fish +251 -0
  54. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/finish.fish +46 -0
  55. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/icons.fish +33 -0
  56. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/prompt_colors.fish +26 -0
  57. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/prompt_connection.fish +31 -0
  58. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish +40 -0
  59. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/prompt_spacing.fish +22 -0
  60. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/show_time.fish +33 -0
  61. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/style.fish +36 -0
  62. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/transient.fish +22 -0
  63. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/classic/classic_prompt_color.fish +38 -0
  64. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/classic/classic_prompt_separators.fish +40 -0
  65. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/lean/lean_prompt_height.fish +26 -0
  66. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_heads.fish +32 -0
  67. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_style.fish +51 -0
  68. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_tails.fish +40 -0
  69. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/powerline/powerline_right_prompt_frame.fish +20 -0
  70. package/dotfiles/macos/.config/fish/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish +40 -0
  71. package/dotfiles/macos/.config/fish/functions/tide/configure/configs/classic.fish +118 -0
  72. package/dotfiles/macos/.config/fish/functions/tide/configure/configs/classic_16color.fish +91 -0
  73. package/dotfiles/macos/.config/fish/functions/tide/configure/configs/lean.fish +118 -0
  74. package/dotfiles/macos/.config/fish/functions/tide/configure/configs/lean_16color.fish +91 -0
  75. package/dotfiles/macos/.config/fish/functions/tide/configure/configs/rainbow.fish +118 -0
  76. package/dotfiles/macos/.config/fish/functions/tide/configure/configs/rainbow_16color.fish +95 -0
  77. package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_cache_variables.fish +41 -0
  78. package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_character.fish +8 -0
  79. package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_cmd_duration.fish +3 -0
  80. package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_git.fish +3 -0
  81. package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_newline.fish +5 -0
  82. package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_os.fish +3 -0
  83. package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_time.fish +3 -0
  84. package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_print_item.fish +22 -0
  85. package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_prompt.fish +42 -0
  86. package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_pwd.fish +11 -0
  87. package/dotfiles/macos/.config/fish/functions/tide/configure/icons.fish +41 -0
  88. package/dotfiles/macos/.config/fish/functions/tide.fish +28 -0
  89. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -186,12 +186,29 @@ async function deleteManifest() {
186
186
  const manifestPath = getManifestPath();
187
187
  if (await pathExists$2(manifestPath)) await remove(manifestPath);
188
188
  }
189
+ const TERMINAL_DEFAULTS = {
190
+ WezTerm: {
191
+ file: "wezterm.lua",
192
+ content: "local wezterm = require 'wezterm'\nreturn {}\n"
193
+ },
194
+ Ghostty: {
195
+ file: "config",
196
+ content: "# defaults\n"
197
+ }
198
+ };
189
199
  async function uninstallGroups(groups) {
190
200
  const errors = [];
191
- for (const group of groups) for (const file of group.files) try {
192
- if (await pathExists$2(file)) await remove(file);
193
- } catch (err) {
194
- errors.push(`${file}: ${err instanceof Error ? err.message : String(err)}`);
201
+ for (const group of groups) {
202
+ const termDefault = TERMINAL_DEFAULTS[group.name];
203
+ try {
204
+ if (termDefault) {
205
+ const configPath = group.files.find((f) => f.endsWith(termDefault.file));
206
+ if (configPath && await pathExists$2(configPath)) await writeFile(configPath, termDefault.content, "utf-8");
207
+ for (const file of group.files) if (file !== configPath && await pathExists$2(file)) await remove(file);
208
+ } else if (await pathExists$2(group.target)) await remove(group.target);
209
+ } catch (err) {
210
+ errors.push(`${group.name}: ${err instanceof Error ? err.message : String(err)}`);
211
+ }
195
212
  }
196
213
  return errors;
197
214
  }
@@ -731,6 +748,7 @@ function showPrerequisites(platform) {
731
748
  log.message(` ${pc.cyan(item.link)}`);
732
749
  }
733
750
  }
751
+ /** Detect tools and show status. Returns missing tools (no install). */
734
752
  async function showToolStatus(groups, platform) {
735
753
  const allTools = [];
736
754
  const groupNames = new Set(groups.map((g) => g.name));
@@ -752,7 +770,7 @@ async function showToolStatus(groups, platform) {
752
770
  installCmd: g.installCmd,
753
771
  required: g.required
754
772
  });
755
- if (allTools.length === 0) return;
773
+ if (allTools.length === 0) return [];
756
774
  const forGroupNames = new Set([...subTools.values()].flat().map((t) => t.name));
757
775
  const requiredTools = [];
758
776
  const optionalTools = [];
@@ -791,45 +809,26 @@ async function showToolStatus(groups, platform) {
791
809
  const subs = subTools.get(t.name);
792
810
  if (subs) for (const st of subs) showSubTool(st);
793
811
  }
794
- if (missing.length > 0) {
795
- const selectedNames = await multiselect({
796
- message: "Install missing tools?",
797
- options: missing.map((t) => ({
798
- value: t.name,
799
- label: `${t.name} ${t.description}`,
800
- hint: t.installCmd
801
- })),
802
- initialValues: missing.map((t) => t.name),
803
- required: false
804
- });
805
- handleCancel(selectedNames);
806
- const toInstall = missing.filter((t) => selectedNames.includes(t.name));
807
- if (toInstall.length > 0) {
808
- const brewFirst = toInstall.filter((t) => t.name === "Homebrew");
809
- const rest = toInstall.filter((t) => t.name !== "Homebrew");
810
- const ordered = [...brewFirst, ...rest];
811
- const total = ordered.length;
812
- let installed = 0;
813
- for (const t of ordered) {
814
- log.message(` ${pc.dim("○")} Installing ${t.name}...`);
815
- try {
816
- execSync(t.installCmd, {
817
- stdio: "pipe",
818
- encoding: "utf-8",
819
- timeout: 3e5
820
- });
821
- installed++;
822
- log.message(` ${pc.green("◆")} ${t.name} installed`);
823
- } catch (err) {
824
- log.message(` ${pc.yellow("⚠")} ${t.name} failed`);
825
- log.message(` ${pc.dim(t.installCmd)} — ${pc.dim(err instanceof Error ? err.message : String(err))}`);
826
- }
827
- }
828
- log.message("");
829
- if (installed === total) log.message(` ${pc.green("◆")} ${installed} tool${installed > 1 ? "s" : ""} installed successfully`);
830
- else log.message(` ${pc.yellow("⚠")} ${installed}/${total} tools installed (${total - installed} failed)`);
831
- }
832
- } else log.success("All tools installed!");
812
+ if (missing.length === 0) log.success("All tools installed!");
813
+ return missing;
814
+ }
815
+ /** Show multiselect picker for missing tools. Returns tools to install (no execution). */
816
+ async function pickMissingTools(missing) {
817
+ const selectedNames = await multiselect({
818
+ message: "Install missing tools?",
819
+ options: missing.map((t) => ({
820
+ value: t.name,
821
+ label: t.name,
822
+ hint: t.installCmd
823
+ })),
824
+ initialValues: missing.map((t) => t.name),
825
+ required: false
826
+ });
827
+ handleCancel(selectedNames);
828
+ const toInstall = missing.filter((t) => selectedNames.includes(t.name));
829
+ const brewFirst = toInstall.filter((t) => t.name === "Homebrew");
830
+ const rest = toInstall.filter((t) => t.name !== "Homebrew");
831
+ return [...brewFirst, ...rest];
833
832
  }
834
833
  const groupCategories = {
835
834
  "Shell & Terminal": [
@@ -884,9 +883,17 @@ function showReloadCommands(groups) {
884
883
  break;
885
884
  }
886
885
  if (reloads.length > 0) {
887
- log.message(pc.bold("\n Reload your configs:"));
888
- for (const r of reloads) log.message(` ${r.name.padEnd(12)} → ${pc.cyan(r.cmd)}`);
886
+ log.info("Reload your configs:");
887
+ for (const r of reloads) log.message(` ${r.name.padEnd(12)} → ${pc.cyan(r.cmd)}`);
889
888
  }
889
+ const restartMsg = "Restart your terminal for all changes to take effect.";
890
+ const w = 57;
891
+ log.message([
892
+ "",
893
+ ` ${pc.dim("╭" + "─".repeat(w) + "╮")}`,
894
+ ` ${pc.dim("│")} ${pc.bold(restartMsg)} ${pc.dim("│")}`,
895
+ ` ${pc.dim("╰" + "─".repeat(w) + "╯")}`
896
+ ].join("\n"));
890
897
  }
891
898
  async function resolvePlatform(flagPlatform) {
892
899
  if (flagPlatform === "macos" || flagPlatform === "windows") return flagPlatform;
@@ -912,13 +919,29 @@ async function resolvePlatform(flagPlatform) {
912
919
  handleCancel(chosen);
913
920
  return chosen;
914
921
  }
915
- async function firstRunFlow(flagPlatform, dryRun = false) {
922
+ async function showUpdateNotification(updatePromise) {
923
+ if (!updatePromise) return;
924
+ const latest = await updatePromise;
925
+ if (!latest) return;
926
+ const msg = `Update available: ${VERSION} → ${latest}`;
927
+ const cmd = "Run: bunx @heyitsiveen/dotfiles@latest";
928
+ const w = Math.max(msg.length, 38) + 4;
929
+ log.message([
930
+ ` ${pc.dim("╭" + "─".repeat(w) + "╮")}`,
931
+ ` ${pc.dim("│")} ${pc.yellow(msg.padEnd(w - 2))}${pc.dim("│")}`,
932
+ ` ${pc.dim("│")} ${pc.cyan(cmd.padEnd(w - 2))}${pc.dim("│")}`,
933
+ ` ${pc.dim("╰" + "─".repeat(w) + "╯")}`
934
+ ].join("\n"));
935
+ }
936
+ async function firstRunFlow(flagPlatform, dryRun = false, updatePromise) {
916
937
  showBanner();
917
938
  intro(pc.bold("heyitsiveen"));
939
+ await showUpdateNotification(updatePromise);
918
940
  const platform = await resolvePlatform(flagPlatform);
919
941
  showPrerequisites(platform);
920
942
  const allGroups = getDotfileGroups(platform);
921
- await showToolStatus(allGroups, platform);
943
+ const missingTools = await showToolStatus(allGroups, platform);
944
+ const toolsToInstall = missingTools.length > 0 ? await pickMissingTools(missingTools) : [];
922
945
  showOverview(allGroups);
923
946
  const depTools = getDependencyTools(platform);
924
947
  const selectedNames = await multiselect({
@@ -929,10 +952,11 @@ async function firstRunFlow(flagPlatform, dryRun = false) {
929
952
  const warnings = [];
930
953
  if (toolMissing) warnings.push("not installed");
931
954
  if (missingDeps.length > 0) warnings.push(`${missingDeps.join(", ")} missing`);
932
- const suffix = warnings.length > 0 ? pc.yellow(` ⚠ (${warnings.join(", ")})`) : "";
955
+ const hint = warnings.length > 0 ? `⚠ ${warnings.join(", ")}` : g.description;
933
956
  return {
934
957
  value: g.name,
935
- label: `${g.name} — ${g.description}${suffix}`
958
+ label: g.name,
959
+ hint
936
960
  };
937
961
  }),
938
962
  initialValues: allGroups.map((g) => g.name),
@@ -975,8 +999,27 @@ async function firstRunFlow(flagPlatform, dryRun = false) {
975
999
  shouldBackup = doBackup;
976
1000
  }
977
1001
  if (dryRun) log.info(pc.yellow("Dry run — showing planned operations:"));
978
- const s = spinner();
979
- s.start("Installing dotfiles...");
1002
+ if (toolsToInstall.length > 0) {
1003
+ log.info("Installing tools...");
1004
+ let toolsInstalled = 0;
1005
+ for (const t of toolsToInstall) {
1006
+ log.message(` ${pc.dim("○")} ${t.name}...`);
1007
+ try {
1008
+ execSync(t.installCmd, {
1009
+ stdio: "pipe",
1010
+ encoding: "utf-8",
1011
+ timeout: 3e5
1012
+ });
1013
+ toolsInstalled++;
1014
+ log.message(` ${pc.green("◆")} ${t.name} installed`);
1015
+ } catch (err) {
1016
+ log.message(` ${pc.yellow("⚠")} ${t.name} failed`);
1017
+ log.message(` ${pc.dim(t.installCmd)} — ${pc.dim(err instanceof Error ? err.message : String(err))}`);
1018
+ }
1019
+ }
1020
+ log.message(` ${pc.green("◆")} ${toolsInstalled}/${toolsToInstall.length} tools installed`);
1021
+ }
1022
+ log.info("Installing dotfiles...");
980
1023
  const result = await install({
981
1024
  platform,
982
1025
  selectedGroups,
@@ -984,8 +1027,21 @@ async function firstRunFlow(flagPlatform, dryRun = false) {
984
1027
  backup: shouldBackup,
985
1028
  dryRun
986
1029
  });
1030
+ for (const ig of result.installedGroups) log.message(` ${pc.green("◆")} ${ig.name} → ${pc.dim(ig.target)}`);
1031
+ log.message(` ${pc.green("◆")} ${result.installedGroups.length}/${selectedGroups.length} configs installed`);
987
1032
  const themeGroups = selectedGroups.filter((g) => g.themeSupport);
988
- if (themeGroups.length > 0) await switchTheme(theme, result.installedGroups.filter((ig) => themeGroups.some((sg) => sg.name === ig.name)), platform, dryRun);
1033
+ if (themeGroups.length > 0) {
1034
+ log.info("Applying theme...");
1035
+ const themeResults = await switchTheme(theme, result.installedGroups.filter((ig) => themeGroups.some((sg) => sg.name === ig.name)), platform, dryRun);
1036
+ for (const r of themeResults) log.message(` ${pc.green("◆")} ${r}`);
1037
+ log.message(` ${pc.green("◆")} Theme: ${theme} activated`);
1038
+ }
1039
+ if (result.backedUp.length > 0) {
1040
+ const unique = [...new Set(result.backedUp)];
1041
+ log.info("Backed up existing configs:");
1042
+ for (const name of unique) log.message(` ${pc.green("◆")} ${name}`);
1043
+ log.message(` ${pc.green("◆")} ${unique.length} configs → ${pc.dim("~/.config/heyitsiveen/dotfiles/backup/")}`);
1044
+ }
989
1045
  if (!dryRun) await createManifest(result, {
990
1046
  platform,
991
1047
  selectedGroups,
@@ -993,27 +1049,14 @@ async function firstRunFlow(flagPlatform, dryRun = false) {
993
1049
  backup: shouldBackup,
994
1050
  dryRun
995
1051
  });
996
- s.stop("Installation complete!");
997
- if (result.backedUp.length > 0) {
998
- const unique = [...new Set(result.backedUp)];
999
- log.message(` ${pc.green("◆")} Backed up ${unique.length} existing configs → ${pc.dim("~/.config/heyitsiveen/dotfiles/backup/")}`);
1000
- }
1001
- for (const [category, names] of Object.entries(groupCategories)) {
1002
- const installed = result.installedGroups.filter((ig) => names.includes(ig.name));
1003
- if (installed.length === 0) continue;
1004
- log.message(` ${pc.bold(category)}`);
1005
- for (const ig of installed) log.message(` ${pc.green("◆")} ${ig.name} → ${pc.dim(ig.target)}`);
1006
- }
1007
- log.message(` ${pc.green("◆")} Theme: ${theme} activated`);
1008
1052
  if (result.errors.length > 0) for (const err of result.errors) log.message(` ${pc.yellow("⚠")} ${err.file}: ${pc.dim(err.error)}`);
1009
1053
  showReloadCommands(selectedGroups);
1010
- log.message("");
1011
- log.info(pc.bold("Restart your terminal for all changes to take effect."));
1012
1054
  outro("Done! Your dotfiles are installed.");
1013
1055
  }
1014
- async function reRunFlow(manifest, flagPlatform, dryRun = false) {
1056
+ async function reRunFlow(manifest, flagPlatform, dryRun = false, updatePromise) {
1015
1057
  showBanner();
1016
1058
  intro(pc.bold("heyitsiveen"));
1059
+ await showUpdateNotification(updatePromise);
1017
1060
  showPrerequisites(manifest.platform);
1018
1061
  log.info(`Existing installation detected (v${manifest.version}, installed ${manifest.installedAt.split("T")[0]})`);
1019
1062
  const mode = await select({
@@ -1127,7 +1170,8 @@ async function uninstallFlow(manifest, dryRun = false) {
1127
1170
  message: "Which configs to remove?",
1128
1171
  options: manifest.groups.map((g) => ({
1129
1172
  value: g.name,
1130
- label: `${g.name} — ${g.target}`
1173
+ label: g.name,
1174
+ hint: g.target
1131
1175
  })),
1132
1176
  initialValues: manifest.groups.map((g) => g.name),
1133
1177
  required: true
@@ -1418,22 +1462,8 @@ runMain(defineCommand({
1418
1462
  await themeFlow(manifest, dryRun, args.theme);
1419
1463
  return;
1420
1464
  }
1421
- if (manifest) await reRunFlow(manifest, args.platform, dryRun);
1422
- else await firstRunFlow(args.platform, dryRun);
1423
- const latest = await updatePromise;
1424
- if (latest) {
1425
- const msg = `Update available: ${VERSION} → ${latest}`;
1426
- const cmd = "Run: bunx @heyitsiveen/dotfiles@latest";
1427
- const w = Math.max(msg.length, 38) + 4;
1428
- console.log([
1429
- "",
1430
- ` ${pc.dim("╭" + "─".repeat(w) + "╮")}`,
1431
- ` ${pc.dim("│")} ${pc.yellow(msg.padEnd(w - 2))}${pc.dim("│")}`,
1432
- ` ${pc.dim("│")} ${pc.cyan(cmd.padEnd(w - 2))}${pc.dim("│")}`,
1433
- ` ${pc.dim("╰" + "─".repeat(w) + "╯")}`,
1434
- ""
1435
- ].join("\n"));
1436
- }
1465
+ if (manifest) await reRunFlow(manifest, args.platform, dryRun, updatePromise);
1466
+ else await firstRunFlow(args.platform, dryRun, updatePromise);
1437
1467
  } catch (err) {
1438
1468
  if (err.code === "ERR_USE_AFTER_CLOSE") process.exit(0);
1439
1469
  log.error(pc.red(err instanceof Error ? err.message : "An unexpected error occurred."));
@@ -0,0 +1,7 @@
1
+ complete --command fisher --exclusive --long help --description "Print help"
2
+ complete --command fisher --exclusive --long version --description "Print version"
3
+ complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins"
4
+ complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins"
5
+ complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins"
6
+ complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex"
7
+ complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)"
@@ -0,0 +1,13 @@
1
+ complete tide --no-files
2
+
3
+ set -l subcommands bug-report configure reload
4
+
5
+ complete tide -x -n __fish_use_subcommand -a bug-report -d "Print info for use in bug reports"
6
+ complete tide -x -n __fish_use_subcommand -a configure -d "Run the configuration wizard"
7
+ complete tide -x -n __fish_use_subcommand -a reload -d "Reload tide configuration"
8
+
9
+ complete tide -x -n "not __fish_seen_subcommand_from $subcommands" -s h -l help -d "Print help message"
10
+ complete tide -x -n "not __fish_seen_subcommand_from $subcommands" -s v -l version -d "Print tide version"
11
+
12
+ complete tide -x -n '__fish_seen_subcommand_from bug-report' -l clean -d "Run clean Fish instance and install Tide"
13
+ complete tide -x -n '__fish_seen_subcommand_from bug-report' -l verbose -d "Print full Tide configuration"
@@ -0,0 +1,44 @@
1
+ function _tide_init_install --on-event _tide_init_install
2
+ set -U VIRTUAL_ENV_DISABLE_PROMPT true
3
+
4
+ source (functions --details _tide_sub_configure)
5
+ _load_config lean
6
+ _tide_finish
7
+
8
+ if status is-interactive
9
+ tide bug-report --check || sleep 4
10
+
11
+ if contains ilancosman/tide (string lower $_fisher_plugins)
12
+ set_color bryellow
13
+ echo "ilancosman/tide is a development branch. Please install from a release tag:"
14
+ _tide_fish_colorize "fisher install ilancosman/tide@v6"
15
+ sleep 3
16
+ end
17
+
18
+ switch (read --prompt-str="Configure tide prompt? [Y/n] " | string lower)
19
+ case y ye yes ''
20
+ tide configure
21
+ case '*'
22
+ echo -s \n 'Run ' (_tide_fish_colorize "tide configure") ' to customize your prompt.'
23
+ end
24
+ end
25
+ end
26
+
27
+ function _tide_init_update --on-event _tide_init_update
28
+ # Warn users who install from main branch
29
+ if contains ilancosman/tide (string lower $_fisher_plugins)
30
+ set_color bryellow
31
+ echo "ilancosman/tide is a development branch. Please install from a release tag:"
32
+ _tide_fish_colorize "fisher install ilancosman/tide@v6"
33
+ sleep 3
34
+ end
35
+
36
+ # Set (disable) the new jobs variable
37
+ set -q tide_jobs_number_threshold || set -U tide_jobs_number_threshold 1000
38
+ end
39
+
40
+ function _tide_init_uninstall --on-event _tide_init_uninstall
41
+ set -e VIRTUAL_ENV_DISABLE_PROMPT
42
+ set -e (set -U --names | string match --entire -r '^_?tide')
43
+ functions --erase (functions --all | string match --entire -r '^_?tide')
44
+ end
@@ -0,0 +1,2 @@
1
+ jorgebucaran/fisher
2
+ ilancosman/tide@v6
@@ -0,0 +1,19 @@
1
+ function _tide_1_line_prompt
2
+ set -g add_prefix
3
+ _tide_side=left for item in $_tide_left_items
4
+ _tide_item_$item
5
+ end
6
+ set_color $prev_bg_color -b normal
7
+ echo $tide_left_prompt_suffix
8
+
9
+ set -g add_prefix
10
+ _tide_side=right for item in $_tide_right_items
11
+ _tide_item_$item
12
+ end
13
+ set_color $prev_bg_color -b normal
14
+ echo $tide_right_prompt_suffix
15
+ end
16
+
17
+ function _tide_item_pwd
18
+ _tide_print_item pwd @PWD@
19
+ end
@@ -0,0 +1,31 @@
1
+ function _tide_2_line_prompt
2
+ set -g add_prefix
3
+ _tide_side=left for item in $_tide_left_items
4
+ _tide_item_$item
5
+ end
6
+ if not set -e add_prefix
7
+ set_color $prev_bg_color -b normal
8
+ echo $tide_left_prompt_suffix
9
+ end
10
+
11
+ echo
12
+
13
+ set -g add_prefix
14
+ _tide_side=right for item in $_tide_right_items
15
+ _tide_item_$item
16
+ end
17
+ if not set -e add_prefix
18
+ set_color $prev_bg_color -b normal
19
+ echo $tide_right_prompt_suffix
20
+ end
21
+ end
22
+
23
+ function _tide_item_pwd
24
+ _tide_print_item pwd @PWD@
25
+ end
26
+
27
+ function _tide_item_newline
28
+ set_color $prev_bg_color -b normal
29
+ v=tide_"$_tide_side"_prompt_suffix echo $$v
30
+ set -g add_prefix
31
+ end
@@ -0,0 +1,17 @@
1
+ function _tide_cache_variables
2
+ # Same-color-separator color
3
+ set_color $tide_prompt_color_separator_same_color | read -gx _tide_color_separator_same_color
4
+
5
+ # git
6
+ contains git $_tide_left_items $_tide_right_items && set_color $tide_git_color_branch | read -gx _tide_location_color
7
+
8
+ # private_mode
9
+ if contains private_mode $_tide_left_items $_tide_right_items && test -n "$fish_private_mode"
10
+ set -gx _tide_private_mode
11
+ else
12
+ set -e _tide_private_mode
13
+ end
14
+
15
+ # item padding
16
+ test "$tide_prompt_pad_items" = true && set -gx _tide_pad ' ' || set -e _tide_pad
17
+ end
@@ -0,0 +1,76 @@
1
+ # Outputs icon, color, bg_color
2
+ function _tide_detect_os
3
+ set -lx defaultColor 080808 CED7CF
4
+ switch (uname | string lower)
5
+ case darwin
6
+ printf %s\n  D6D6D6 333333 # from apple.com header
7
+ case freebsd openbsd dragonfly
8
+ printf %s\n  FFFFFF AB2B28 # https://freebsdfoundation.org/about-us/about-the-foundation/project/
9
+ case 'cygwin*' 'mingw*_nt*' 'msys_nt*'
10
+ printf %s\n  FFFFFF 00CCFF # https://answers.microsoft.com/en-us/windows/forum/all/what-is-the-official-windows-8-blue-rgb-or-hex/fd57144b-f69b-42d8-8c21-6ca911646e44
11
+ case linux
12
+ if test (uname -o) = Android
13
+ # https://developer.android.com/distribute/marketing-tools/brand-guidelines
14
+ printf %s\n  3DDC84 3C3F41 # fg is from above link, bg is from Android Studio default dark theme
15
+ else
16
+ _tide_detect_os_linux_cases /etc/os-release ID ||
17
+ _tide_detect_os_linux_cases /etc/os-release ID_LIKE ||
18
+ _tide_detect_os_linux_cases /etc/lsb-release DISTRIB_ID ||
19
+ printf %s\n  $defaultColor
20
+ end
21
+ case '*'
22
+ echo -ns '?'
23
+ end
24
+ end
25
+
26
+ function _tide_detect_os_linux_cases -a file key
27
+ test -e $file || return
28
+ set -l split_file (string split '=' <$file)
29
+ set -l key_index (contains --index $key $split_file) || return
30
+ set -l value (string trim --chars='"' $split_file[(math $key_index + 1)])
31
+
32
+ # Anything which would have pure white background has been changed to D4D4D4
33
+ # It was just too bright otherwise
34
+ switch (string lower $value)
35
+ case alpine
36
+ printf %s\n  FFFFFF 0D597F # from alpine logo
37
+ case arch
38
+ printf %s\n  1793D1 4D4D4D # from arch wiki header
39
+ case centos
40
+ printf %s\n  000000 D4D4D4 # https://wiki.centos.org/ArtWork/Brand/Logo, monochromatic
41
+ case debian
42
+ printf %s\n  C70036 D4D4D4 # from debian logo https://www.debian.org/logos/openlogo-nd-100.png
43
+ case devuan
44
+ printf %s\n  $defaultColor # logo is monochromatic
45
+ case elementary
46
+ printf %s\n  000000 D4D4D4 # https://elementary.io/brand, encouraged to be monochromatic
47
+ case fedora
48
+ printf %s\n  FFFFFF 294172 # from logo https://fedoraproject.org/w/uploads/2/2d/Logo_fedoralogo.png
49
+ case gentoo
50
+ printf %s\n  FFFFFF 54487A # https://wiki.gentoo.org/wiki/Project:Artwork/Colors
51
+ case mageia
52
+ printf %s\n  FFFFFF 262F45 # https://wiki.mageia.org/en/Artwork_guidelines
53
+ case manjaro
54
+ printf %s\n  FFFFFF 35BF5C # from https://gitlab.manjaro.org/artwork/branding/logo/-/blob/master/logo.svg
55
+ case mint linuxmint
56
+ printf %s\n  FFFFFF 69B53F # extracted from https://linuxmint.com/web/img/favicon.ico
57
+ case nixos
58
+ printf %s\n  FFFFFF 5277C3 # https://github.com/NixOS/nixos-artwork/tree/master/logo
59
+ case opensuse-leap opensuse-tumbleweed opensuse-microos
60
+ printf %s\n  73BA25 173f4f # https://en.opensuse.org/openSUSE:Artwork_brand
61
+ case raspbian
62
+ printf %s\n  FFFFFF A22846 # https://static.raspberrypi.org/files/Raspberry_Pi_Visual_Guidelines_2020.pdf
63
+ case rhel
64
+ printf %s\n  EE0000 000000 # https://www.redhat.com/en/about/brand/standards/color
65
+ case sabayon
66
+ printf %s\n  $defaultColor # Can't find colors, and they are rebranding anyway
67
+ case slackware
68
+ printf %s\n  $defaultColor # Doesn't really have a logo, and the colors are too close to PWD blue anyway
69
+ case ubuntu
70
+ printf %s\n  E95420 D4D4D4 # https://design.ubuntu.com/brand/
71
+ case void
72
+ printf %s\n  FFFFFF 478061 # from https://alpha.de.repo.voidlinux.org/logos/void.svg
73
+ case '*'
74
+ return 1
75
+ end
76
+ end
@@ -0,0 +1,3 @@
1
+ function _tide_find_and_remove -a name list --no-scope-shadowing
2
+ contains --index $name $$list | read -l index && set -e "$list"[$index]
3
+ end
@@ -0,0 +1,7 @@
1
+ function _tide_fish_colorize
2
+ if command -q fish_indent
3
+ echo -ns "$argv" | fish_indent --ansi
4
+ else
5
+ echo -ns "$argv"
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ function _tide_item_aws
2
+ # AWS_PROFILE overrides AWS_DEFAULT_PROFILE, AWS_REGION overrides AWS_DEFAULT_REGION
3
+ set -q AWS_PROFILE && set -l AWS_DEFAULT_PROFILE $AWS_PROFILE
4
+ set -q AWS_REGION && set -l AWS_DEFAULT_REGION $AWS_REGION
5
+
6
+ if test -n "$AWS_DEFAULT_PROFILE" && test -n "$AWS_DEFAULT_REGION"
7
+ _tide_print_item aws $tide_aws_icon' ' "$AWS_DEFAULT_PROFILE/$AWS_DEFAULT_REGION"
8
+ else if test -n "$AWS_DEFAULT_PROFILE$AWS_DEFAULT_REGION"
9
+ _tide_print_item aws $tide_aws_icon' ' "$AWS_DEFAULT_PROFILE$AWS_DEFAULT_REGION"
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ function _tide_item_bun
2
+ if path is $_tide_parent_dirs/bun.lockb
3
+ bun --version | string match -qr "(?<v>.*)"
4
+ _tide_print_item bun $tide_bun_icon' ' $v
5
+ end
6
+ end
@@ -0,0 +1,17 @@
1
+ function _tide_item_character
2
+ test $_tide_status = 0 && set_color $tide_character_color || set_color $tide_character_color_failure
3
+
4
+ set -q add_prefix || echo -ns ' '
5
+
6
+ test "$fish_key_bindings" = fish_default_key_bindings && echo -ns $tide_character_icon ||
7
+ switch $fish_bind_mode
8
+ case insert
9
+ echo -ns $tide_character_icon
10
+ case default
11
+ echo -ns $tide_character_vi_icon_default
12
+ case replace replace_one
13
+ echo -ns $tide_character_vi_icon_replace
14
+ case visual
15
+ echo -ns $tide_character_vi_icon_visual
16
+ end
17
+ end
@@ -0,0 +1,12 @@
1
+ function _tide_item_cmd_duration
2
+ test $CMD_DURATION -gt $tide_cmd_duration_threshold && t=(
3
+ math -s0 "$CMD_DURATION/3600000" # Hours
4
+ math -s0 "$CMD_DURATION/60000"%60 # Minutes
5
+ math -s$tide_cmd_duration_decimals "$CMD_DURATION/1000"%60) if test $t[1] != 0
6
+ _tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[1]h $t[2]m $t[3]s"
7
+ else if test $t[2] != 0
8
+ _tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[2]m $t[3]s"
9
+ else
10
+ _tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[3]s"
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ function _tide_item_context
2
+ if set -q SSH_TTY
3
+ set -fx tide_context_color $tide_context_color_ssh
4
+ else if test "$EUID" = 0
5
+ set -fx tide_context_color $tide_context_color_root
6
+ else if test "$tide_context_always_display" = true
7
+ set -fx tide_context_color $tide_context_color_default
8
+ else
9
+ return
10
+ end
11
+
12
+ string match -qr "^(?<h>(\.?[^\.]*){0,$tide_context_hostname_parts})" @$hostname
13
+ _tide_print_item context $USER$h
14
+ end
@@ -0,0 +1,6 @@
1
+ function _tide_item_crystal
2
+ if path is $_tide_parent_dirs/shard.yml
3
+ crystal --version | string match -qr "(?<v>[\d.]+)"
4
+ _tide_print_item crystal $tide_crystal_icon' ' $v
5
+ end
6
+ end
@@ -0,0 +1,7 @@
1
+ function _tide_item_direnv
2
+ set -q DIRENV_DIR || return
3
+ direnv status | string match -q 'Found RC allowed false' &&
4
+ set -lx tide_direnv_color $tide_direnv_color_denied &&
5
+ set -lx tide_direnv_bg_color $tide_direnv_bg_color_denied
6
+ _tide_print_item direnv $tide_direnv_icon
7
+ end
@@ -0,0 +1,4 @@
1
+ function _tide_item_distrobox
2
+ test -e /etc/profile.d/distrobox_profile.sh && test -e /run/.containerenv &&
3
+ _tide_print_item distrobox $tide_distrobox_icon' ' (string match -rg 'name="(.*)"' </run/.containerenv)
4
+ end
@@ -0,0 +1,5 @@
1
+ function _tide_item_docker
2
+ docker context inspect --format '{{.Name}}' | read -l context
3
+ contains -- "$context" $tide_docker_default_contexts ||
4
+ _tide_print_item docker $tide_docker_icon' ' $context
5
+ end
@@ -0,0 +1,4 @@
1
+ function _tide_item_elixir
2
+ path is $_tide_parent_dirs/mix.exs &&
3
+ _tide_print_item elixir $tide_elixir_icon' ' (elixir --short-version)
4
+ end
@@ -0,0 +1,8 @@
1
+ function _tide_item_gcloud
2
+ set -q CLOUDSDK_CONFIG || set -l CLOUDSDK_CONFIG ~/.config/gcloud
3
+ path is $CLOUDSDK_CONFIG/active_config &&
4
+ read -l config <$CLOUDSDK_CONFIG/active_config &&
5
+ path is $CLOUDSDK_CONFIG/configurations/config_$config &&
6
+ string match -qr '^\s*project\s*=\s*(?<project>.*)' <$CLOUDSDK_CONFIG/configurations/config_$config &&
7
+ _tide_print_item gcloud $tide_gcloud_icon' ' $project
8
+ end