@keepgoingdev/cli 0.3.0 → 0.3.1
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 +5 -3
- package/dist/index.js +20 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,17 +50,19 @@ Git branch and touched files are auto-detected from the workspace.
|
|
|
50
50
|
|
|
51
51
|
Install a shell hook that runs `keepgoing status --quiet` automatically whenever you `cd` into a directory that contains `.keepgoing/`.
|
|
52
52
|
|
|
53
|
-
Supports **zsh** and **
|
|
53
|
+
Supports **zsh**, **bash**, and **fish**. Detected from `$SHELL`.
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
56
|
keepgoing hook install
|
|
57
57
|
# → Reload your shell:
|
|
58
|
-
source ~/.zshrc
|
|
58
|
+
source ~/.zshrc # zsh
|
|
59
|
+
source ~/.bashrc # bash
|
|
60
|
+
source ~/.config/fish/config.fish # fish
|
|
59
61
|
```
|
|
60
62
|
|
|
61
63
|
### `keepgoing hook uninstall`
|
|
62
64
|
|
|
63
|
-
Remove the shell hook from your
|
|
65
|
+
Remove the shell hook from your shell config file.
|
|
64
66
|
|
|
65
67
|
```bash
|
|
66
68
|
keepgoing hook uninstall
|
package/dist/index.js
CHANGED
|
@@ -140,7 +140,6 @@ var STALE_SESSION_MS = 2 * 60 * 60 * 1e3;
|
|
|
140
140
|
function pruneStaleTasks(tasks) {
|
|
141
141
|
const now = Date.now();
|
|
142
142
|
return tasks.filter((t) => {
|
|
143
|
-
if (t.sessionActive) return true;
|
|
144
143
|
const updatedAt = new Date(t.updatedAt).getTime();
|
|
145
144
|
return !isNaN(updatedAt) && now - updatedAt < STALE_SESSION_MS;
|
|
146
145
|
});
|
|
@@ -633,7 +632,7 @@ import { spawn } from "child_process";
|
|
|
633
632
|
import { readFileSync, existsSync } from "fs";
|
|
634
633
|
import path6 from "path";
|
|
635
634
|
import os2 from "os";
|
|
636
|
-
var CLI_VERSION = "0.3.
|
|
635
|
+
var CLI_VERSION = "0.3.1";
|
|
637
636
|
var NPM_REGISTRY_URL = "https://registry.npmjs.org/@keepgoingdev/cli/latest";
|
|
638
637
|
var FETCH_TIMEOUT_MS = 5e3;
|
|
639
638
|
var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
@@ -831,6 +830,16 @@ if command -v keepgoing >/dev/null 2>&1; then
|
|
|
831
830
|
}
|
|
832
831
|
fi
|
|
833
832
|
${HOOK_MARKER_END}`;
|
|
833
|
+
var FISH_HOOK = `${HOOK_MARKER_START}
|
|
834
|
+
# KeepGoing shell hook, auto-injected by 'keepgoing hook install'
|
|
835
|
+
if command -v keepgoing >/dev/null 2>&1
|
|
836
|
+
function __keepgoing_on_pwd_change --on-variable PWD
|
|
837
|
+
if test -d .keepgoing
|
|
838
|
+
keepgoing status --quiet
|
|
839
|
+
end
|
|
840
|
+
end
|
|
841
|
+
end
|
|
842
|
+
${HOOK_MARKER_END}`;
|
|
834
843
|
function detectShellRcFile() {
|
|
835
844
|
const shellEnv = process.env["SHELL"] ?? "";
|
|
836
845
|
const home = os3.homedir();
|
|
@@ -840,18 +849,22 @@ function detectShellRcFile() {
|
|
|
840
849
|
if (shellEnv.endsWith("bash")) {
|
|
841
850
|
return { shell: "bash", rcFile: path8.join(home, ".bashrc") };
|
|
842
851
|
}
|
|
852
|
+
if (shellEnv.endsWith("fish")) {
|
|
853
|
+
const xdgConfig = process.env["XDG_CONFIG_HOME"] || path8.join(home, ".config");
|
|
854
|
+
return { shell: "fish", rcFile: path8.join(xdgConfig, "fish", "config.fish") };
|
|
855
|
+
}
|
|
843
856
|
return void 0;
|
|
844
857
|
}
|
|
845
858
|
function hookInstallCommand() {
|
|
846
859
|
const detected = detectShellRcFile();
|
|
847
860
|
if (!detected) {
|
|
848
861
|
console.error(
|
|
849
|
-
'Could not detect your shell. Set $SHELL to "zsh" or "
|
|
862
|
+
'Could not detect your shell. Set $SHELL to "zsh", "bash", or "fish" and try again.'
|
|
850
863
|
);
|
|
851
864
|
process.exit(1);
|
|
852
865
|
}
|
|
853
866
|
const { shell, rcFile } = detected;
|
|
854
|
-
const hookBlock = shell === "zsh" ? ZSH_HOOK : BASH_HOOK;
|
|
867
|
+
const hookBlock = shell === "zsh" ? ZSH_HOOK : shell === "fish" ? FISH_HOOK : BASH_HOOK;
|
|
855
868
|
let existing = "";
|
|
856
869
|
try {
|
|
857
870
|
existing = fs5.readFileSync(rcFile, "utf-8");
|
|
@@ -873,7 +886,7 @@ function hookUninstallCommand() {
|
|
|
873
886
|
const detected = detectShellRcFile();
|
|
874
887
|
if (!detected) {
|
|
875
888
|
console.error(
|
|
876
|
-
'Could not detect your shell. Set $SHELL to "zsh" or "
|
|
889
|
+
'Could not detect your shell. Set $SHELL to "zsh", "bash", or "fish" and try again.'
|
|
877
890
|
);
|
|
878
891
|
process.exit(1);
|
|
879
892
|
}
|
|
@@ -1012,7 +1025,7 @@ Options:
|
|
|
1012
1025
|
-h, --help Show this help text
|
|
1013
1026
|
|
|
1014
1027
|
Hook subcommands:
|
|
1015
|
-
keepgoing hook install Install the shell hook
|
|
1028
|
+
keepgoing hook install Install the shell hook (zsh, bash, fish)
|
|
1016
1029
|
keepgoing hook uninstall Remove the shell hook
|
|
1017
1030
|
`;
|
|
1018
1031
|
function parseArgs(argv) {
|
|
@@ -1065,7 +1078,7 @@ async function main() {
|
|
|
1065
1078
|
}
|
|
1066
1079
|
break;
|
|
1067
1080
|
case "version":
|
|
1068
|
-
console.log(`keepgoing v${"0.3.
|
|
1081
|
+
console.log(`keepgoing v${"0.3.1"}`);
|
|
1069
1082
|
break;
|
|
1070
1083
|
case "activate":
|
|
1071
1084
|
await activateCommand({ licenseKey: subcommand });
|