@clerc/plugin-version 0.12.3 → 0.12.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.
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { definePlugin } from '@clerc/core';
2
- import { gracefulVersion } from '@clerc/utils';
2
+
3
+ const gracefulVersion = (v) => v.length === 0 ? "" : v.startsWith("v") ? v : `v${v}`;
3
4
 
4
5
  const versionPlugin = ({
5
6
  alias = ["V"],
@@ -12,7 +13,7 @@ const versionPlugin = ({
12
13
  fn: (ctx, next) => {
13
14
  if (!ctx.isSingleCommand && command) {
14
15
  cli = cli.command("version", "Show version").on("version", () => {
15
- console.log(gracefullyVersion);
16
+ process.stdout.write(gracefullyVersion);
16
17
  });
17
18
  }
18
19
  next();
@@ -31,7 +32,7 @@ const versionPlugin = ({
31
32
  if (!hasVersionFlag) {
32
33
  next();
33
34
  } else {
34
- console.log(gracefullyVersion);
35
+ process.stdout.write(gracefullyVersion);
35
36
  }
36
37
  }
37
38
  });
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { definePlugin } from '@clerc/core';
2
- import { gracefulVersion } from '@clerc/utils';
2
+
3
+ const gracefulVersion = (v) => v.length === 0 ? "" : v.startsWith("v") ? v : `v${v}`;
3
4
 
4
5
  const versionPlugin = ({
5
6
  alias = ["V"],
@@ -12,7 +13,7 @@ const versionPlugin = ({
12
13
  fn: (ctx, next) => {
13
14
  if (!ctx.isSingleCommand && command) {
14
15
  cli = cli.command("version", "Show version").on("version", () => {
15
- console.log(gracefullyVersion);
16
+ process.stdout.write(gracefullyVersion);
16
17
  });
17
18
  }
18
19
  next();
@@ -31,7 +32,7 @@ const versionPlugin = ({
31
32
  if (!hasVersionFlag) {
32
33
  next();
33
34
  } else {
34
- console.log(gracefullyVersion);
35
+ process.stdout.write(gracefullyVersion);
35
36
  }
36
37
  }
37
38
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerc/plugin-version",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
4
4
  "author": "Ray <nn_201312@163.com> (https://github.com/so1ve)",
5
5
  "description": "Clerc plugin version",
6
6
  "keywords": [
@@ -43,7 +43,7 @@
43
43
  "@clerc/core": "*"
44
44
  },
45
45
  "devDependencies": {
46
- "@clerc/core": "0.12.3"
46
+ "@clerc/core": "0.12.5"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "puild",