mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-27 02:44:50 +01:00
fix(cli): harden install integration checks
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
1c5b6c1caf
commit
8354cecede
4 files changed
+27
-6
No files matched your search
@@ -1,6 +1,9 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
PC_INSTALL_DRIVER="${PC_INSTALL_DRIVER:-source}"
|
||||
|
||||
PC_TEST_ROOT="$(mktemp -d "${TMPDIR:-/tmp}/paperclip-clean-install.XXXXXX")"
|
||||
PC_HOME="$PC_TEST_ROOT/home"
|
||||
PC_CACHE="$PC_TEST_ROOT/npm-cache"
|
||||
@@ -13,8 +16,11 @@ export npm_config_cache="$PC_CACHE"
|
||||
export npm_config_userconfig="$PC_HOME/.npmrc"
|
||||
export PATH="$PC_HOME/.local/bin:$PATH"
|
||||
|
||||
cd "$PC_TEST_ROOT"
|
||||
npx --yes --registry https://registry.npmjs.org paperclipai install
|
||||
if [ "$PC_INSTALL_DRIVER" = "published" ]; then
|
||||
(cd "$PC_TEST_ROOT" && npx --yes --registry https://registry.npmjs.org paperclipai install)
|
||||
else
|
||||
(cd "$REPO_ROOT" && pnpm paperclipai install --yes)
|
||||
fi
|
||||
|
||||
test -x "$PC_HOME/.local/bin/paperclipai"
|
||||
test -L "$PAPERCLIP_HOME/cli/current"
|
||||
@@ -23,7 +29,7 @@ paperclipai --version
|
||||
|
||||
mkdir -p "$PAPERCLIP_HOME/instances/default"
|
||||
touch "$PAPERCLIP_HOME/instances/default/user-data-marker"
|
||||
paperclipai uninstall
|
||||
(cd "$REPO_ROOT" && pnpm paperclipai uninstall)
|
||||
|
||||
test ! -e "$PAPERCLIP_HOME/cli"
|
||||
test ! -e "$PC_HOME/.local/bin/paperclipai"
|
||||
|
||||
Reference in new issue
Block a user