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.
- package/README.md +7 -0
- package/index.js +28 -1
- package/package.json +6 -1
package/README.md
ADDED
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
|
-
│ --
|
|
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
|
+
"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
|
}
|