tylersong 1.0.3 → 1.0.4

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 (3) hide show
  1. package/README.md +7 -0
  2. package/index.js +28 -1
  3. package/package.json +6 -1
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # 버전 업데이트
2
+
3
+ `npm version patch` # 또는 minor/major
4
+
5
+ # 태그와 함께 GitHub에 푸시
6
+
7
+ `git push origin main --tags`
package/index.js CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  import inquirer from "inquirer";
4
4
  import chalk from "chalk";
5
+ import { program } from "commander";
6
+ import { exec } from "child_process";
7
+
8
+ const openUrl = (url) => {
9
+ const command =
10
+ process.platform === "win32"
11
+ ? "start"
12
+ : process.platform === "darwin"
13
+ ? "open"
14
+ : "xdg-open";
15
+ exec(`${command} ${url}`);
16
+ };
17
+
18
+ program.version("1.0.3").description("송민성의 개발자 프로필 CLI");
19
+
20
+ program.option("-g, --github", "GitHub 프로필 열기");
21
+
22
+ program.parse(process.argv);
23
+
24
+ const options = program.opts();
25
+
26
+ if (Object.keys(options).length > 0) {
27
+ if (options.github) openUrl("https://github.com/alstjd0051");
28
+ process.exit(0);
29
+ }
5
30
 
6
31
  const main = async () => {
7
32
  // 도움말 옵션 체크
@@ -14,7 +39,9 @@ const main = async () => {
14
39
  │ npx tylerSong │
15
40
  │ │
16
41
  │ 옵션: │
17
- │ --help 도움말 표시
42
+ -V, --version 버전 정보
43
+ │ -g, --github GitHub 열기 │
44
+ │ -h, --help 도움말 │
18
45
  ╰───────────────────────────────╯
19
46
  `)
20
47
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tylersong",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "나의 CLI 자기소개 도구",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -14,5 +14,10 @@
14
14
  "license": "MIT",
15
15
  "scripts": {
16
16
  "test": "echo \"No test specified\""
17
+ },
18
+ "dependencies": {
19
+ "chalk": "^5.4.1",
20
+ "commander": "^13.1.0",
21
+ "inquirer": "^12.4.2"
17
22
  }
18
23
  }