Installer
This commit is contained in:
parent
12760ed095
commit
4cb1328ad6
3 changed files with 119 additions and 2 deletions
12
Makefile
12
Makefile
|
|
@ -29,7 +29,7 @@ RUN_FLAGS := \
|
|||
-v $(STATE_DIR):/home/dev/.local/state/opencode \
|
||||
-w /workspace
|
||||
|
||||
.PHONY: build opencode shell
|
||||
.PHONY: build opencode shell install
|
||||
|
||||
# Only relevant on macOS, where podman requires a running VM ("podman
|
||||
# machine"). Handles "machine exists but stopped" -> start it. Does NOT
|
||||
|
|
@ -67,3 +67,13 @@ shell:
|
|||
@$(ENSURE_MACHINE)
|
||||
@$(ENSURE_NETWORK)
|
||||
podman run $(RUN_FLAGS) $(IMAGE) bash
|
||||
|
||||
# Builds the image, then installs a global `opencode-sandbox` shortcut on
|
||||
# the host (see scripts/install-shortcut.sh for what "installs" means -- a
|
||||
# shim in ~/.local/bin plus a PATH edit for the user's login shell). Kept out
|
||||
# of the recipe itself: multi-line shell-with-conditionals in a Make recipe
|
||||
# means doubling every $ as $$ and fighting Make's per-line shell splitting
|
||||
# (see the ENSURE_MACHINE comment above) -- not worth it for something this
|
||||
# size.
|
||||
install: build
|
||||
sh scripts/install-shortcut.sh "$(CURDIR)"
|
||||
|
|
|
|||
Reference in a new issue