@wwkit/cft 1.0.16 → 1.0.17
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/index.js +6 -0
- package/package.json +2 -2
package/bin/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { execSync } from 'node:child_process'
|
|
4
|
+
import { readFileSync } from 'node:fs'
|
|
4
5
|
import { install, status, clear, showConfig, showEnv } from '../src/index.js'
|
|
5
6
|
|
|
7
|
+
const pkgVersion = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version
|
|
8
|
+
|
|
6
9
|
const command = process.argv[2]
|
|
7
10
|
|
|
8
11
|
if (command === 'install') {
|
|
@@ -28,6 +31,8 @@ if (command === 'install') {
|
|
|
28
31
|
showEnv()
|
|
29
32
|
} else if (command === 'upgrade') {
|
|
30
33
|
execSync('npm install -g @wwkit/cft@latest', { stdio: 'inherit' })
|
|
34
|
+
} else if (command === 'version') {
|
|
35
|
+
console.log(pkgVersion)
|
|
31
36
|
} else if (command === 'help' || command === undefined) {
|
|
32
37
|
console.log(`cft - Chrome for Testing 安装器
|
|
33
38
|
|
|
@@ -38,6 +43,7 @@ if (command === 'install') {
|
|
|
38
43
|
cft env 显示 cft 创建的全局环境变量
|
|
39
44
|
cft clear 删除安装产物(~/.config/cft/)
|
|
40
45
|
cft upgrade 升级 cft 自身(npm install -g @wwkit/cft@latest)
|
|
46
|
+
cft version 显示版本号
|
|
41
47
|
cft help 显示本帮助
|
|
42
48
|
|
|
43
49
|
安装目录: ~/.config/cft/`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wwkit/cft",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"author": "bluesliu <langcai163@163.com>",
|
|
5
5
|
"description": "Chrome for Testing (CFT) installer — download, extract, chmod, dep-check",
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"extract-zip": "^2.0.1",
|
|
39
|
-
"@wwkit/shared": "1.0.
|
|
39
|
+
"@wwkit/shared": "1.0.17"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"jest": "^29.7.0"
|