@snelusha/noto 1.2.4 → 1.2.5

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 +24 -1
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -826,6 +826,7 @@ var command4 = {
826
826
  ],
827
827
  execute: withRepository(
828
828
  async (options) => {
829
+ const args = options._.slice(1);
829
830
  if (!options.isRepo) {
830
831
  p6.log.error(
831
832
  dedent6`${color6.red("no git repository found in cwd.")}
@@ -839,6 +840,28 @@ var command4 = {
839
840
  return await exit(1);
840
841
  }
841
842
  const currentBranch = await getCurrentBranch();
843
+ const branchName = args[0];
844
+ if (branchName) {
845
+ if (!branches.includes(branchName)) {
846
+ p6.log.error(
847
+ `branch ${color6.red(branchName)} does not exist in the repository`
848
+ );
849
+ return await exit(1);
850
+ }
851
+ if (branchName === currentBranch) {
852
+ p6.log.error(
853
+ `${color6.red("already on branch")} ${color6.green(branchName)}`
854
+ );
855
+ return await exit(1);
856
+ }
857
+ const result2 = await checkout(branchName);
858
+ if (!result2) {
859
+ p6.log.error(`failed to checkout ${color6.bold(branchName)}`);
860
+ return await exit(1);
861
+ }
862
+ p6.log.success(`checked out ${color6.green(branchName)}`);
863
+ return await exit(0);
864
+ }
842
865
  const branch = await p6.select({
843
866
  message: "select a branch to checkout",
844
867
  options: branches.map((branch2) => ({
@@ -1045,7 +1068,7 @@ var listCommand = () => {
1045
1068
  };
1046
1069
 
1047
1070
  // package.json
1048
- var version = "1.2.4";
1071
+ var version = "1.2.5";
1049
1072
 
1050
1073
  // src/index.ts
1051
1074
  var globalSpec = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snelusha/noto",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Generate clean commit messages in a snap! ✨",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -41,7 +41,7 @@
41
41
  "cli"
42
42
  ],
43
43
  "devDependencies": {
44
- "@types/node": "^22.15.19",
44
+ "@types/node": "^22.15.23",
45
45
  "tsup": "^8.5.0",
46
46
  "typescript": "^5.8.3",
47
47
  "vitest": "^3.1.4"
@@ -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.3"
59
+ "zod": "^3.25.32"
60
60
  }
61
61
  }