@workscribe/cli 1.10.0 → 1.12.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.md +2 -0
- package/dist/index.js +1435 -848
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/shell/hook.bash +1 -1
- package/shell/hook.fish +34 -0
- package/shell/hook.zsh +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workscribe/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "Passive developer work journal — automatic terminal activity summaries",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build": "tsup",
|
|
11
11
|
"preuninstall": "workscribe uninstall --hooks-only 2>/dev/null; exit 0",
|
|
12
12
|
"prepack": "npm run build",
|
|
13
|
-
"postbuild": "
|
|
13
|
+
"postbuild": "node scripts/postbuild.js",
|
|
14
14
|
"dev": "tsx src/index.ts",
|
|
15
15
|
"watch": "tsup --watch",
|
|
16
16
|
"typecheck": "tsc --noEmit",
|
package/shell/hook.bash
CHANGED
|
@@ -16,7 +16,7 @@ _workscribe_precmd() {
|
|
|
16
16
|
local now
|
|
17
17
|
now=$(date +%s%3N 2>/dev/null || echo 0)
|
|
18
18
|
local duration=$(( now - _workscribe_cmd_start ))
|
|
19
|
-
workscribe _capture \
|
|
19
|
+
command workscribe _capture \
|
|
20
20
|
--cmd "$_workscribe_last_cmd" \
|
|
21
21
|
--cwd "$PWD" \
|
|
22
22
|
--exit "$exit_code" \
|
package/shell/hook.fish
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Workscribe — developer work journal
|
|
2
|
+
# Do not edit this file manually. Managed by `workscribe init`.
|
|
3
|
+
# workscribe:hook:start
|
|
4
|
+
function _workscribe_preexec --on-event fish_preexec
|
|
5
|
+
set -g _workscribe_cmd $argv[1]
|
|
6
|
+
set -g _workscribe_git_before (git rev-parse HEAD 2>/dev/null; or echo "")
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
function _workscribe_postexec --on-event fish_postexec
|
|
10
|
+
set -l exit_code $status
|
|
11
|
+
type -q workscribe
|
|
12
|
+
or return 0
|
|
13
|
+
if set -q _workscribe_cmd; and test -n "$_workscribe_cmd"
|
|
14
|
+
if test -n "$_workscribe_git_before"
|
|
15
|
+
command workscribe _capture \
|
|
16
|
+
--cmd "$_workscribe_cmd" \
|
|
17
|
+
--cwd "$PWD" \
|
|
18
|
+
--exit "$exit_code" \
|
|
19
|
+
--duration "$CMD_DURATION" \
|
|
20
|
+
--git-before "$_workscribe_git_before" \
|
|
21
|
+
> /dev/null 2>&1 &
|
|
22
|
+
else
|
|
23
|
+
command workscribe _capture \
|
|
24
|
+
--cmd "$_workscribe_cmd" \
|
|
25
|
+
--cwd "$PWD" \
|
|
26
|
+
--exit "$exit_code" \
|
|
27
|
+
--duration "$CMD_DURATION" \
|
|
28
|
+
> /dev/null 2>&1 &
|
|
29
|
+
end
|
|
30
|
+
set -e _workscribe_cmd
|
|
31
|
+
set -e _workscribe_git_before
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
# workscribe:hook:end
|
package/shell/hook.zsh
CHANGED
|
@@ -13,7 +13,7 @@ _workscribe_precmd() {
|
|
|
13
13
|
if [[ -n "$_workscribe_cmd" ]]; then
|
|
14
14
|
local _raw_ms=$(( ($EPOCHREALTIME - $_workscribe_cmd_start) * 1000 ))
|
|
15
15
|
local duration_ms=${_raw_ms%%.*}
|
|
16
|
-
workscribe _capture \
|
|
16
|
+
command workscribe _capture \
|
|
17
17
|
--cmd "$_workscribe_cmd" \
|
|
18
18
|
--cwd "$PWD" \
|
|
19
19
|
--exit "$exit_code" \
|