@batijs/cli 0.0.234-beta.3 → 0.0.234

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 +26 -15
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -5,8 +5,8 @@ import {
5
5
  } from "./chunk-MFJ4ET44.js";
6
6
 
7
7
  // index.ts
8
- import { existsSync as existsSync2 } from "fs";
9
- import { exec as nodeExec } from "child_process";
8
+ import { existsSync as existsSync2, rmSync } from "fs";
9
+ import { execSync } from "child_process";
10
10
  import { access, constants, lstat, readdir, readFile as readFile3 } from "fs/promises";
11
11
  import { dirname, join, parse } from "path";
12
12
  import { fileURLToPath } from "url";
@@ -1588,7 +1588,7 @@ var createDefaultQueryTester = function(query, options) {
1588
1588
  // package.json
1589
1589
  var package_default = {
1590
1590
  name: "@batijs/cli",
1591
- version: "0.0.234-beta.3",
1591
+ version: "0.0.234",
1592
1592
  type: "module",
1593
1593
  scripts: {
1594
1594
  "check-types": "tsc --noEmit",
@@ -1880,21 +1880,32 @@ function testFlags(flags, bl) {
1880
1880
  }
1881
1881
  return true;
1882
1882
  }
1883
- async function gitInit(cwd) {
1883
+ function gitInit(cwd) {
1884
+ const exists = which("git");
1885
+ if (!exists) return;
1884
1886
  try {
1885
- const exists = which("git");
1886
- if (!exists) return;
1887
- await new Promise((resolve, reject) => {
1888
- nodeExec("git init", { cwd }, (err) => {
1889
- if (err) {
1890
- reject(err);
1891
- } else {
1892
- resolve(void 0);
1893
- }
1894
- });
1887
+ execSync("git init", {
1888
+ cwd,
1889
+ stdio: "ignore"
1895
1890
  });
1891
+ execSync("git add .", { cwd, stdio: "ignore" });
1892
+ execSync(
1893
+ [
1894
+ "git",
1895
+ '-c user.name="Bati"',
1896
+ '-c user.email="no-reply@batijs.dev"',
1897
+ "commit",
1898
+ "--no-gpg-sign",
1899
+ '--message="scaffold Vike app with Bati"'
1900
+ ].join(" "),
1901
+ { cwd, stdio: "ignore" }
1902
+ );
1896
1903
  } catch (e) {
1897
- console.warn(`${yellow("\u26A0")} failed to execute \`git init\` in destination folder. Skipping.`);
1904
+ try {
1905
+ rmSync(join(cwd, ".git"), { recursive: true, force: true });
1906
+ } catch {
1907
+ }
1908
+ console.warn(`${yellow("\u26A0")} failed to initialize a git repository in destination folder. Skipping.`);
1898
1909
  }
1899
1910
  }
1900
1911
  async function run() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@batijs/cli",
3
- "version": "0.0.234-beta.3",
3
+ "version": "0.0.234",
4
4
  "type": "module",
5
5
  "keywords": [],
6
6
  "description": "Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want",
@@ -20,12 +20,12 @@
20
20
  "typescript": "^5.5.3",
21
21
  "unplugin-purge-polyfills": "^0.0.4",
22
22
  "vite": "^5.3.4",
23
- "@batijs/build": "0.0.234-beta.3",
24
- "@batijs/compile": "0.0.234-beta.3"
23
+ "@batijs/compile": "0.0.234",
24
+ "@batijs/build": "0.0.234"
25
25
  },
26
26
  "dependencies": {
27
- "@batijs/core": "0.0.234-beta.3",
28
- "@batijs/features": "0.0.234-beta.3"
27
+ "@batijs/features": "0.0.234",
28
+ "@batijs/core": "0.0.234"
29
29
  },
30
30
  "bin": "./dist/index.js",
31
31
  "exports": {