@0x-jerry/x 2.1.1 → 2.2.0
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/{chunk-5X7RM5CJ.js → chunk-OL62CB6T.js} +10 -1
- package/dist/xn.js +1 -1
- package/dist/xr.js +1 -1
- package/package.json +3 -3
- package/readme.md +19 -19
|
@@ -2,10 +2,19 @@
|
|
|
2
2
|
import { execa } from "execa";
|
|
3
3
|
import { stat } from "fs/promises";
|
|
4
4
|
import pc from "picocolors";
|
|
5
|
+
import os from "os";
|
|
5
6
|
async function run(cmd, env) {
|
|
6
7
|
console.log(pc.dim("$"), pc.dim(cmd));
|
|
7
8
|
try {
|
|
8
|
-
|
|
9
|
+
if (os.platform() === "win32") {
|
|
10
|
+
const finalCmd = JSON.stringify(cmd).replaceAll(`\\"`, '`"');
|
|
11
|
+
await execa("powershell", ["Invoke-Expression", finalCmd], {
|
|
12
|
+
stdio: "inherit",
|
|
13
|
+
env
|
|
14
|
+
});
|
|
15
|
+
} else {
|
|
16
|
+
await execa("sh", ["-c", cmd], { stdio: "inherit", env });
|
|
17
|
+
}
|
|
9
18
|
} catch (error) {
|
|
10
19
|
process.exit(1);
|
|
11
20
|
}
|
package/dist/xn.js
CHANGED
package/dist/xr.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0x-jerry/x",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"repository": "https://github.com/0x-jerry/x.git",
|
|
6
6
|
"author": "Jerry Wang <x.jerry.wang@gmail.com>",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "module",
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public",
|
|
11
|
-
"registry": "https://registry.npmjs.
|
|
11
|
+
"registry": "https://registry.npmjs.com"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"dist"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"prompts": "^2.4.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@0x-jerry/x-release": "^0.
|
|
47
|
+
"@0x-jerry/x-release": "^0.4.0",
|
|
48
48
|
"@types/decompress": "^4.2.4",
|
|
49
49
|
"@types/fs-extra": "^11.0.2",
|
|
50
50
|
"@types/global-agent": "^2.1.1",
|
package/readme.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# X
|
|
2
|
-
|
|
3
|
-
Some useful command for myself.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm i -g @0x-jerry/x
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Command Completions
|
|
12
|
-
|
|
13
|
-
Add this code to `~/.zshrc`
|
|
14
|
-
|
|
15
|
-
```zsh
|
|
16
|
-
source <(x completions)
|
|
17
|
-
source <(xr completions)
|
|
18
|
-
source <(xn completions)
|
|
19
|
-
```
|
|
1
|
+
# X
|
|
2
|
+
|
|
3
|
+
Some useful command for myself.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm i -g @0x-jerry/x
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Command Completions
|
|
12
|
+
|
|
13
|
+
Add this code to `~/.zshrc`
|
|
14
|
+
|
|
15
|
+
```zsh
|
|
16
|
+
source <(x completions)
|
|
17
|
+
source <(xr completions)
|
|
18
|
+
source <(xn completions)
|
|
19
|
+
```
|