bunkit-cli 1.0.1 → 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 (2) hide show
  1. package/dist/index.js +15 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -18565,7 +18565,9 @@ async function isGitAvailable() {
18565
18565
  async function initGit(cwd2) {
18566
18566
  await execa("git", ["init"], { cwd: cwd2 });
18567
18567
  await execa("git", ["add", "-A"], { cwd: cwd2 });
18568
- await execa("git", ["commit", "-m", "Initial commit from bunkit", "--no-verify"], { cwd: cwd2 });
18568
+ try {
18569
+ await execa("git", ["commit", "-m", "Initial commit from bunkit", "--no-verify"], { cwd: cwd2 });
18570
+ } catch {}
18569
18571
  }
18570
18572
  async function isGitRepository(cwd2) {
18571
18573
  try {
@@ -23042,17 +23044,24 @@ var init_monorepo = __esm(() => {
23042
23044
  });
23043
23045
 
23044
23046
  // ../core/src/presets.ts
23047
+ function getPresetsDir() {
23048
+ return join(process.env.HOME || process.env.USERPROFILE || ".", ".bunkit");
23049
+ }
23050
+ function getPresetsFile() {
23051
+ return join(getPresetsDir(), "presets.json");
23052
+ }
23045
23053
  async function loadCustomPresets() {
23046
23054
  try {
23047
- await ensureDirectory(PRESETS_DIR);
23048
- const content = await readFile(PRESETS_FILE);
23055
+ const presetsDir = getPresetsDir();
23056
+ await ensureDirectory(presetsDir);
23057
+ const content = await readFile(getPresetsFile());
23049
23058
  return JSON.parse(content);
23050
23059
  } catch (error) {
23051
23060
  return {};
23052
23061
  }
23053
23062
  }
23054
23063
  async function saveCustomPreset(preset) {
23055
- await ensureDirectory(PRESETS_DIR);
23064
+ await ensureDirectory(getPresetsDir());
23056
23065
  const presets = await loadCustomPresets();
23057
23066
  const existing = presets[preset.name];
23058
23067
  presets[preset.name] = {
@@ -23060,7 +23069,7 @@ async function saveCustomPreset(preset) {
23060
23069
  createdAt: existing?.createdAt || new Date().toISOString(),
23061
23070
  updatedAt: new Date().toISOString()
23062
23071
  };
23063
- await writeFile(PRESETS_FILE, JSON.stringify(presets, null, 2));
23072
+ await writeFile(getPresetsFile(), JSON.stringify(presets, null, 2));
23064
23073
  }
23065
23074
  async function deleteCustomPreset(name) {
23066
23075
  const presets = await loadCustomPresets();
@@ -23068,7 +23077,7 @@ async function deleteCustomPreset(name) {
23068
23077
  return false;
23069
23078
  }
23070
23079
  delete presets[name];
23071
- await writeFile(PRESETS_FILE, JSON.stringify(presets, null, 2));
23080
+ await writeFile(getPresetsFile(), JSON.stringify(presets, null, 2));
23072
23081
  return true;
23073
23082
  }
23074
23083
  async function getCustomPreset(name) {
@@ -23079,12 +23088,9 @@ async function listCustomPresets() {
23079
23088
  const presets = await loadCustomPresets();
23080
23089
  return Object.values(presets);
23081
23090
  }
23082
- var PRESETS_DIR, PRESETS_FILE;
23083
23091
  var init_presets = __esm(() => {
23084
23092
  init_dist();
23085
23093
  init_fs();
23086
- PRESETS_DIR = join(process.env.HOME || process.env.USERPROFILE || ".", ".bunkit");
23087
- PRESETS_FILE = join(PRESETS_DIR, "presets.json");
23088
23094
  });
23089
23095
 
23090
23096
  // ../core/src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunkit-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Beautiful CLI for creating production-ready Bun projects",
5
5
  "type": "module",
6
6
  "bin": {