hsh19900502 1.0.1 → 1.0.3

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/bin/hsh.mjs ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env zx
2
+ import { require } from '../src/utils.mjs';
3
+ import { gcm } from '../src/commands/commit.mjs';
4
+
5
+ const { Command } = require('commander');
6
+
7
+ const program = new Command();
8
+
9
+ program.usage('<command> [options]')
10
+ program.version(require('../package').version)
11
+
12
+ program.command('gcm')
13
+ .description('commit changes')
14
+ // .option('-m, --message <message>', 'commit message')
15
+ .argument('<words...>')
16
+ .action((words) => {
17
+ console.log(words)
18
+ gcm(words.join(' '))
19
+ })
20
+
21
+ program.parse();
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "hsh19900502",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "bin": {
10
- "hsh": "bin/hsh"
10
+ "hsh": "bin/hsh.mjs"
11
11
  },
12
12
  "keywords": [],
13
13
  "author": "",
@@ -17,6 +17,7 @@
17
17
  "commander": "^12.0.0",
18
18
  "inquirer": "^9.2.15",
19
19
  "log-symbols": "^6.0.0",
20
- "ora": "^8.0.1"
20
+ "ora": "^8.0.1",
21
+ "zx": "^7.2.3"
21
22
  }
22
23
  }
@@ -0,0 +1,6 @@
1
+ import 'zx/globals'
2
+
3
+ export const gcm = async function (message) {
4
+ await $`git add -A`
5
+ await $`git commit -m ${message}`
6
+ }
package/src/utils.mjs ADDED
@@ -0,0 +1,3 @@
1
+
2
+ import { createRequire } from 'module';
3
+ export const require = createRequire(import.meta.url);
package/bin/hsh DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- console.log('hello world xx')