@snelusha/noto 1.2.5 → 1.2.6

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 +33 -2
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -220,7 +220,15 @@ var getBranches = async (remote) => {
220
220
  };
221
221
  var checkout = async (branch) => {
222
222
  try {
223
- await git.checkout(branch);
223
+ await git.checkout(branch, {});
224
+ return true;
225
+ } catch {
226
+ return false;
227
+ }
228
+ };
229
+ var checkoutLocalBranch = async (branch) => {
230
+ try {
231
+ await git.checkoutLocalBranch(branch);
224
232
  return true;
225
233
  } catch {
226
234
  return false;
@@ -822,6 +830,12 @@ var command4 = {
822
830
  flag: "--copy",
823
831
  alias: "-c",
824
832
  description: "copy the selected branch to clipboard"
833
+ },
834
+ {
835
+ type: Boolean,
836
+ flag: "--create",
837
+ alias: "-b",
838
+ description: "create a new branch"
825
839
  }
826
840
  ],
827
841
  execute: withRepository(
@@ -841,6 +855,23 @@ var command4 = {
841
855
  }
842
856
  const currentBranch = await getCurrentBranch();
843
857
  const branchName = args[0];
858
+ if (options["--create"]) {
859
+ if (branches.includes(branchName)) {
860
+ p6.log.error(
861
+ `branch ${color6.red(branchName)} already exists in the repository`
862
+ );
863
+ return await exit(1);
864
+ }
865
+ const result2 = await checkoutLocalBranch(branchName);
866
+ if (!result2) {
867
+ p6.log.error(
868
+ `failed to create and checkout ${color6.bold(branchName)}`
869
+ );
870
+ return await exit(1);
871
+ }
872
+ p6.log.success(`created and checked out ${color6.green(branchName)}`);
873
+ return await exit(0);
874
+ }
844
875
  if (branchName) {
845
876
  if (!branches.includes(branchName)) {
846
877
  p6.log.error(
@@ -1068,7 +1099,7 @@ var listCommand = () => {
1068
1099
  };
1069
1100
 
1070
1101
  // package.json
1071
- var version = "1.2.5";
1102
+ var version = "1.2.6";
1072
1103
 
1073
1104
  // src/index.ts
1074
1105
  var globalSpec = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snelusha/noto",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Generate clean commit messages in a snap! ✨",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -44,10 +44,10 @@
44
44
  "@types/node": "^22.15.23",
45
45
  "tsup": "^8.5.0",
46
46
  "typescript": "^5.8.3",
47
- "vitest": "^3.1.4"
47
+ "vitest": "^3.2.0"
48
48
  },
49
49
  "dependencies": {
50
- "@ai-sdk/google": "^1.2.18",
50
+ "@ai-sdk/google": "^1.2.19",
51
51
  "@clack/prompts": "^0.10.1",
52
52
  "ai": "^4.3.16",
53
53
  "arg": "^5.0.2",
@@ -56,6 +56,6 @@
56
56
  "picocolors": "^1.1.1",
57
57
  "simple-git": "^3.27.0",
58
58
  "tinyexec": "^0.3.2",
59
- "zod": "^3.25.32"
59
+ "zod": "^3.25.49"
60
60
  }
61
61
  }