hintshell 0.3.7 → 0.3.8
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 +2 -6
- package/package.json +1 -1
- package/scripts/npm-install.js +7 -1
- package/scripts/npm-install.test.js +15 -3
- package/scripts/npm-stop.js +1 -2
package/README.md
CHANGED
|
@@ -62,13 +62,9 @@ HintShell uses `fzf` to render the suggestion picker on Bash/Zsh (including **Gi
|
|
|
62
62
|
- **Windows PowerShell**: No extra dependencies for the real-time overlay.
|
|
63
63
|
|
|
64
64
|
### 2. Install HintShell
|
|
65
|
-
Install via
|
|
65
|
+
Install via npm to get the latest pre-built binaries for your platform. Add `--foreground-scripts` to show the binary download, extraction, and setup output (this is also what `hs update` uses):
|
|
66
66
|
```bash
|
|
67
|
-
npm install -g hintshell@latest
|
|
68
|
-
|
|
69
|
-
or
|
|
70
|
-
|
|
71
|
-
npm i -g hintshell@latest --foreground-scripts
|
|
67
|
+
npm install -g hintshell@latest --foreground-scripts
|
|
72
68
|
```
|
|
73
69
|
|
|
74
70
|
### 3. Initialize Shell Integration
|
package/package.json
CHANGED
package/scripts/npm-install.js
CHANGED
|
@@ -57,7 +57,13 @@ function getDownloadUrl(target, ext) {
|
|
|
57
57
|
|
|
58
58
|
function downloadFile(url, dest, options = {}) {
|
|
59
59
|
const requestTimeoutMs = options.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
|
|
60
|
-
|
|
60
|
+
let parsedUrl;
|
|
61
|
+
try {
|
|
62
|
+
parsedUrl = new URL(url);
|
|
63
|
+
} catch {
|
|
64
|
+
return Promise.reject(new Error(`Download failed: invalid URL ${url}`));
|
|
65
|
+
}
|
|
66
|
+
if (parsedUrl.protocol === "file:") {
|
|
61
67
|
return new Promise((resolve, reject) => {
|
|
62
68
|
fs.copyFile(fileURLToPath(url), dest, (error) => (error ? reject(error) : resolve()));
|
|
63
69
|
});
|
|
@@ -18,11 +18,23 @@ function listen(handler) {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
test("Windows stop script
|
|
21
|
+
test("Windows stop script stops only live wrapper processes", () => {
|
|
22
22
|
const script = fs.readFileSync(path.join(__dirname, "npm-stop.js"), "utf8");
|
|
23
23
|
assert.match(script, /hintshell-core\.exe/);
|
|
24
|
-
assert.match(script, /hintshell\.exe/);
|
|
25
|
-
assert.match(script, /
|
|
24
|
+
assert.match(script, /Name = 'hintshell\.exe'/);
|
|
25
|
+
assert.match(script, /CommandLine -match/);
|
|
26
|
+
assert.match(script, /CommandLine -match .*bash/);
|
|
27
|
+
assert.doesNotMatch(script, /taskkill", \["\/F", "\/IM", "hintshell\.exe"\]/);
|
|
28
|
+
assert.doesNotMatch(script, /Get-Process -Name 'hintshell', 'hintshell-core'/);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test("PowerShell update exposes npm lifecycle progress without duplicate init", () => {
|
|
32
|
+
const module = fs.readFileSync(
|
|
33
|
+
path.join(__dirname, "..", "integrations", "powershell", "HintShellModule", "HintShellModule.psm1"),
|
|
34
|
+
"utf8"
|
|
35
|
+
);
|
|
36
|
+
assert.match(module, /npm install -g hintshell@latest --foreground-scripts --fetch-timeout=30000 --fetch-retries=1/);
|
|
37
|
+
assert.doesNotMatch(module, /Ensuring local install \(hintshell init\)/);
|
|
26
38
|
});
|
|
27
39
|
|
|
28
40
|
test("isolated tests skip global process control", () => {
|
package/scripts/npm-stop.js
CHANGED
|
@@ -47,11 +47,10 @@ function stopRunningDaemon(reason) {
|
|
|
47
47
|
|
|
48
48
|
if (IS_WIN) {
|
|
49
49
|
run("taskkill", ["/F", "/IM", "hintshell-core.exe"]);
|
|
50
|
-
run("taskkill", ["/F", "/IM", "hintshell.exe"]);
|
|
51
50
|
run("powershell", [
|
|
52
51
|
"-NoProfile",
|
|
53
52
|
"-Command",
|
|
54
|
-
"Get-
|
|
53
|
+
"Get-CimInstance Win32_Process -Filter \"Name = 'hintshell.exe'\" | Where-Object { $_.CommandLine -match '\\s+bash(?:\\s|$)' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }",
|
|
55
54
|
]);
|
|
56
55
|
} else {
|
|
57
56
|
run("pkill", ["-f", "hintshell-core"]);
|