@inquirer/external-editor 3.0.3 → 3.0.5
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 +13 -0
- package/package.json +4 -3
- package/dist/errors/CreateFileError.d.ts +0 -10
- package/dist/errors/CreateFileError.js +0 -13
- package/dist/errors/LaunchEditorError.d.ts +0 -10
- package/dist/errors/LaunchEditorError.js +0 -13
- package/dist/errors/ReadFileError.d.ts +0 -10
- package/dist/errors/ReadFileError.js +0 -13
- package/dist/errors/RemoveFileError.d.ts +0 -10
- package/dist/errors/RemoveFileError.js +0 -13
package/README.md
CHANGED
|
@@ -77,6 +77,19 @@ try {
|
|
|
77
77
|
}
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
+
### Windows editor commands
|
|
81
|
+
|
|
82
|
+
On Windows, prefer setting `$VISUAL` or `$EDITOR` to the editor executable
|
|
83
|
+
rather than a `.cmd` or `.bat` shim. This package launches the editor directly
|
|
84
|
+
instead of through a shell so editor arguments and temporary file paths are not
|
|
85
|
+
interpreted as shell commands.
|
|
86
|
+
|
|
87
|
+
For example, use `Code.exe` with `--wait` instead of `code.cmd`:
|
|
88
|
+
|
|
89
|
+
```powershell
|
|
90
|
+
setx VISUAL '"C:\Program Files\Microsoft VS Code\Code.exe" --wait'
|
|
91
|
+
```
|
|
92
|
+
|
|
80
93
|
#### API
|
|
81
94
|
|
|
82
95
|
**Convenience Functions**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquirer/external-editor",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "Edit a string with the users preferred text editor using $VISUAL or $ENVIRONMENT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"answer",
|
|
@@ -76,8 +76,9 @@
|
|
|
76
76
|
"iconv-lite": "^0.7.2"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
+
"@repo/tsconfig": "0.0.0",
|
|
79
80
|
"@types/chardet": "^1.0.0",
|
|
80
|
-
"@types/node": "^
|
|
81
|
+
"@types/node": "^26.1.1",
|
|
81
82
|
"typescript": "^6.0.2"
|
|
82
83
|
},
|
|
83
84
|
"peerDependencies": {
|
|
@@ -93,5 +94,5 @@
|
|
|
93
94
|
},
|
|
94
95
|
"main": "./dist/index.js",
|
|
95
96
|
"types": "./dist/index.d.ts",
|
|
96
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "5748bd9966b5e175ddf5995ee4cdce6f60c4272e"
|
|
97
98
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/***
|
|
2
|
-
* Node External Editor
|
|
3
|
-
*
|
|
4
|
-
* Kevin Gravier <kevin@mrkmg.com>
|
|
5
|
-
* MIT 2018
|
|
6
|
-
*/
|
|
7
|
-
export class CreateFileError extends Error {
|
|
8
|
-
originalError;
|
|
9
|
-
constructor(originalError) {
|
|
10
|
-
super(`Failed to create temporary file. ${originalError.message}`);
|
|
11
|
-
this.originalError = originalError;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/***
|
|
2
|
-
* Node External Editor
|
|
3
|
-
*
|
|
4
|
-
* Kevin Gravier <kevin@mrkmg.com>
|
|
5
|
-
* MIT 2018
|
|
6
|
-
*/
|
|
7
|
-
export class LaunchEditorError extends Error {
|
|
8
|
-
originalError;
|
|
9
|
-
constructor(originalError) {
|
|
10
|
-
super(`Failed to launch editor. ${originalError.message}`);
|
|
11
|
-
this.originalError = originalError;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/***
|
|
2
|
-
* Node External Editor
|
|
3
|
-
*
|
|
4
|
-
* Kevin Gravier <kevin@mrkmg.com>
|
|
5
|
-
* MIT 2018
|
|
6
|
-
*/
|
|
7
|
-
export class ReadFileError extends Error {
|
|
8
|
-
originalError;
|
|
9
|
-
constructor(originalError) {
|
|
10
|
-
super(`Failed to read temporary file. ${originalError.message}`);
|
|
11
|
-
this.originalError = originalError;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/***
|
|
2
|
-
* Node External Editor
|
|
3
|
-
*
|
|
4
|
-
* Kevin Gravier <kevin@mrkmg.com>
|
|
5
|
-
* MIT 2018
|
|
6
|
-
*/
|
|
7
|
-
export class RemoveFileError extends Error {
|
|
8
|
-
originalError;
|
|
9
|
-
constructor(originalError) {
|
|
10
|
-
super(`Failed to remove temporary file. ${originalError.message}`);
|
|
11
|
-
this.originalError = originalError;
|
|
12
|
-
}
|
|
13
|
-
}
|