Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ fi

echo "Installing Clone with ${CLAUDE_BIN}..."

if ! "${CLAUDE_BIN}" plugin marketplace add "${GITHUB_REPO}@main"; then
run_claude() {
"${CLAUDE_BIN}" "$@" </dev/null
}

if ! run_claude plugin marketplace add "${GITHUB_REPO}@main"; then
echo "Marketplace add did not complete; refreshing ${MARKETPLACE_NAME} if it already exists."
"${CLAUDE_BIN}" plugin marketplace update "${MARKETPLACE_NAME}" || true
run_claude plugin marketplace update "${MARKETPLACE_NAME}" || true
fi

if ! "${CLAUDE_BIN}" plugin install "${PLUGIN_REF}" --scope user; then
if ! run_claude plugin install "${PLUGIN_REF}" --scope user; then
echo "Install did not complete; trying plugin update for an existing install."
"${CLAUDE_BIN}" plugin update "${PLUGIN_REF}"
run_claude plugin update "${PLUGIN_REF}"
fi

echo
Expand Down
1 change: 1 addition & 0 deletions tests/repo-identity.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ describe('repository identity', () => {

assert.match(installer, /GITHUB_REPO="cloneisyou\/clone-loop"/)
assert.match(installer, /PLUGIN_REF="clone-labs@clone-loop"/)
assert.match(installer, /"\$\{CLAUDE_BIN\}" "\$@" <\/dev\/null/)
assert.match(installer, /plugin marketplace update "\$\{MARKETPLACE_NAME\}"/)
assert.match(installer, /gh repo star "\$\{GITHUB_REPO\}"/)
assert.doesNotMatch(installer, /Star .* now\?/)
Expand Down