Skip to content

Commit 69168aa

Browse files
committed
fix: link strip-ansi into pi-coding-agent
1 parent f808e99 commit 69168aa

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

flake.nix

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
fi
2828
exec node-gyp "$@"
2929
'';
30-
stripAnsiSrc = ./nix/vendor/strip-ansi;
3130
in {
3231
clawdbot-gateway = prev.clawdbot-gateway.overrideAttrs (old: {
3332
env = (old.env or {}) // {
@@ -70,12 +69,18 @@
7069
postInstall = (old.postInstall or "") + ''
7170
pi_dir="$(find "$out/lib/clawdbot/node_modules/.pnpm" -maxdepth 1 -type d -name "@mariozechner+pi-coding-agent@*" | head -n1)"
7271
if [ -z "$pi_dir" ]; then
73-
echo "pi-coding-agent directory not found for strip-ansi shim" >&2
72+
echo "pi-coding-agent directory not found for strip-ansi link" >&2
73+
exit 1
74+
fi
75+
strip_src="$(find "$out/lib/clawdbot/node_modules/.pnpm" -maxdepth 2 -type d -path "*strip-ansi@*/node_modules/strip-ansi" | head -n1)"
76+
if [ -z "$strip_src" ]; then
77+
echo "strip-ansi not found in pnpm store" >&2
7478
exit 1
7579
fi
7680
target="$pi_dir/node_modules/strip-ansi"
77-
mkdir -p "$target"
78-
cp -R ${stripAnsiSrc}/* "$target"/
81+
rm -rf "$target"
82+
mkdir -p "$(dirname "$target")"
83+
ln -s "$strip_src" "$target"
7984
'';
8085
});
8186
};

nix/vendor/strip-ansi/index.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

nix/vendor/strip-ansi/package.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)