Skip to content

Commit 32602bc

Browse files
Merge pull request #3 from udithavithanage/fix/windows-explorer-open
Fix thyra open command on Windows when THYRA_EDITOR = explorer
2 parents db10b77 + b61c4c9 commit 32602bc

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ A tiny CLI to bookmark project folders under short names and open them instantly
1515

1616
- Save any directory under a short, memorable name
1717
- Open saved directories instantly from the terminal
18+
- Check the CLI version easily (`thyra version`)
1819
- Works with any editor (VS Code, WebStorm, Vim, Sublime Text, Emacs, etc.)
1920
- Stores configuration in your user directory
2021
- Cross-platform: macOS, Linux, Windows
@@ -46,6 +47,9 @@ thyra open blog
4647

4748
# See everything you saved
4849
thyra list
50+
51+
# Check thyra version
52+
thyra version
4953
```
5054

5155
---
@@ -92,10 +96,24 @@ blog → /Users/you/projects/personal-blog
9296
api → /var/www/company/api
9397
```
9498

99+
### Show CLI version
100+
101+
```bash
102+
thyra --version
103+
```
104+
105+
**Output**
106+
107+
```
108+
v1.0.5
109+
```
110+
111+
This shows the currently installed version of **thyra**.
112+
95113
### Help
96114

97115
```bash
98-
thyra help
116+
thyra --help
99117
```
100118

101119
---
@@ -166,6 +184,9 @@ thyra open docs
166184

167185
# View all
168186
thyra list
187+
188+
# Check thyra version
189+
thyra version
169190
```
170191

171192
---

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "thyra",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "Simple project folder opener CLI",
55
"type": "module",
66
"bin": {

src/editor.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import { exec } from "child_process";
22

33
export function openInEditor(folderPath) {
44
const editorCmd = process.env.THYRA_EDITOR || "code";
5-
6-
const safePath = folderPath.replace(/(["\\$`])/g, "\\$1");
5+
let safePath = folderPath;
6+
if (editorCmd.trim() != "explorer") {
7+
safePath = folderPath.replace(/(["\\$`])/g, "\\$1");
8+
}
79
const command = `${editorCmd} "${safePath}"`;
810

911
console.log(`Opening "${folderPath}" in "${editorCmd}"...`);
@@ -16,7 +18,7 @@ export function openInEditor(folderPath) {
1618
process.stderr.write(stderr);
1719
}
1820

19-
if (error) {
21+
if (error && editorCmd !== "explorer") {
2022
console.error(
2123
`Failed to start editor "${editorCmd}". Is it installed and on your PATH?`
2224
);

0 commit comments

Comments
 (0)