Skip to content
Open
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
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Copyright (c) 2026 Lark Technologies Pte. Ltd.
# SPDX-License-Identifier: MIT
#
# END USERS / AI ASSISTANTS: To upgrade an existing lark-cli install, run
# `lark-cli update`. `make install` here is for CONTRIBUTORS building from
# source — it will NOT match official release artifacts and may break the
# self-update flow.

BINARY := lark-cli
MODULE := github.com/larksuite/cli
Expand Down Expand Up @@ -28,6 +33,22 @@ integration-test: build
test: vet unit-test integration-test

install: build
@if [ -n "$$I_AM_A_CONTRIBUTOR" ]; then \
: ; \
Comment on lines +36 to +37
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Tighten contributor bypass to the documented =1 value.

Line 36 currently bypasses on any non-empty I_AM_A_CONTRIBUTOR value, which is looser than the documented contract (I_AM_A_CONTRIBUTOR=1).

Suggested patch
-	`@if` [ -n "$$I_AM_A_CONTRIBUTOR" ]; then \
+	`@if` [ "$$I_AM_A_CONTRIBUTOR" = "1" ]; then \
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@if [ -n "$$I_AM_A_CONTRIBUTOR" ]; then \
: ; \
`@if` [ "$$I_AM_A_CONTRIBUTOR" = "1" ]; then \
: ; \
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Makefile` around lines 36 - 37, The contributor bypass condition in the
Makefile currently triggers for any non-empty I_AM_A_CONTRIBUTOR; change the
conditional to only succeed when I_AM_A_CONTRIBUTOR is exactly "1". Locate the
conditional that references I_AM_A_CONTRIBUTOR (the line starting with `@if` [ -n
"$$I_AM_A_CONTRIBUTOR" ]; then) and replace the test with an exact string
comparison against "1" (so the block only runs when I_AM_A_CONTRIBUTOR=1),
preserving Makefile variable escaping and the existing then/else block
structure.

elif [ -t 0 ] && [ -t 1 ]; then \
echo "" ; \
echo " make install builds from source — for CONTRIBUTORS only." ; \
echo " To upgrade an existing lark-cli, run: lark-cli update" ; \
echo "" ; \
printf " Continue installing from source? (y/N) " ; \
read ans ; \
case "$$ans" in y|Y|yes|YES) ;; *) echo "Aborted." ; exit 1 ;; esac ; \
else \
echo "make install: refusing in non-interactive mode." ; \
echo " To upgrade lark-cli: run \`lark-cli update\`." ; \
echo " To install from source non-interactively: I_AM_A_CONTRIBUTOR=1 make install" ; \
exit 1 ; \
fi
install -d $(PREFIX)/bin
install -m755 $(BINARY) $(PREFIX)/bin/$(BINARY)
@echo "OK: $(PREFIX)/bin/$(BINARY) ($(VERSION))"
Expand Down
Loading