@sanohiro/casty 0.5.9 → 1.0.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/README.ja.md +15 -0
- package/README.md +15 -0
- package/bin/casty +7 -6
- package/bin/casty.js +29 -0
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -153,6 +153,21 @@ lib/bookmarks.js ブックマーク検索
|
|
|
153
153
|
|
|
154
154
|
</details>
|
|
155
155
|
|
|
156
|
+
## トラブルシューティング
|
|
157
|
+
|
|
158
|
+
casty が起動しない、または Chrome がクラッシュする場合、ブラウザキャッシュを削除してください:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
rm -rf ~/.casty/browsers
|
|
162
|
+
casty # Chrome が自動で再ダウンロードされます
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
すべての設定とプロファイルをリセットするには:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
rm -rf ~/.casty
|
|
169
|
+
```
|
|
170
|
+
|
|
156
171
|
## ライセンス
|
|
157
172
|
|
|
158
173
|
MIT
|
package/README.md
CHANGED
|
@@ -153,6 +153,21 @@ lib/bookmarks.js Bookmark search
|
|
|
153
153
|
|
|
154
154
|
</details>
|
|
155
155
|
|
|
156
|
+
## Troubleshooting
|
|
157
|
+
|
|
158
|
+
If casty fails to start or Chrome crashes, try removing the browser cache:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
rm -rf ~/.casty/browsers
|
|
162
|
+
casty # re-downloads Chrome automatically
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
To reset all settings and profile data:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
rm -rf ~/.casty
|
|
169
|
+
```
|
|
170
|
+
|
|
156
171
|
## License
|
|
157
172
|
|
|
158
173
|
MIT
|
package/bin/casty
CHANGED
|
@@ -134,13 +134,14 @@ install_chromium() {
|
|
|
134
134
|
echo "casty: Installed Chrome Headless Shell ${version}" >&2
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
# 古いブラウザバージョンを削除 (最新
|
|
137
|
+
# 古いブラウザバージョンを削除 (最新2つを残す)
|
|
138
|
+
# Running casty may still use the previous version, so keep 2 to avoid
|
|
139
|
+
# breaking a live session. The older one gets cleaned up on next update.
|
|
138
140
|
cleanup_old_browsers() {
|
|
139
|
-
local
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
[ -n "$oldest" ] && rm -rf "$oldest"
|
|
141
|
+
local dirs=$(ls -t -d "$BROWSERS_DIR"/chrome-headless-shell-*/ 2>/dev/null)
|
|
142
|
+
local count=$(echo "$dirs" | wc -l)
|
|
143
|
+
[ "$count" -le 2 ] && return
|
|
144
|
+
echo "$dirs" | tail -n +3 | while read -r d; do rm -rf "$d"; done
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
# 初回: ブラウザがなければインストール (ブロッキング)
|
package/bin/casty.js
CHANGED
|
@@ -13,6 +13,35 @@ if (process.argv[2] === '--version' || process.argv[2] === '-v') {
|
|
|
13
13
|
process.exit(0);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
// --help / -h
|
|
17
|
+
if (process.argv[2] === '--help' || process.argv[2] === '-h') {
|
|
18
|
+
console.log(`casty - A real Chrome browser in your terminal
|
|
19
|
+
|
|
20
|
+
Usage: casty [url] [options]
|
|
21
|
+
|
|
22
|
+
Options:
|
|
23
|
+
--help, -h Show this help
|
|
24
|
+
--version, -v Show version
|
|
25
|
+
|
|
26
|
+
Key bindings:
|
|
27
|
+
Alt+L Address bar
|
|
28
|
+
Alt+F Hint mode (Vimium-style link navigation)
|
|
29
|
+
Alt+C Copy selected text
|
|
30
|
+
Ctrl+V Paste from clipboard
|
|
31
|
+
Alt+Left/Right Back / Forward
|
|
32
|
+
Ctrl+Q Quit
|
|
33
|
+
|
|
34
|
+
Address bar:
|
|
35
|
+
Type a URL or search query, then Enter
|
|
36
|
+
/b [query] Search bookmarks
|
|
37
|
+
|
|
38
|
+
Config: ~/.casty/config.json
|
|
39
|
+
Keys: ~/.casty/keys.json
|
|
40
|
+
|
|
41
|
+
https://github.com/sanohiro/casty`);
|
|
42
|
+
process.exit(0);
|
|
43
|
+
}
|
|
44
|
+
|
|
16
45
|
// Ensure Chrome is installed (skip if launched from bin/casty shell script)
|
|
17
46
|
if (!process.env.CASTY_ENSURE_CHROME) {
|
|
18
47
|
const __bin = dirname(fileURLToPath(import.meta.url));
|