Skip to content

Commit 33d831d

Browse files
committed
cli: Add Makefile with install and editable targets
1 parent c4c3561 commit 33d831d

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

cli/Makefile

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
PIPX := $(shell command -v pipx 2>/dev/null)
2+
PIPX_INSTALL_ARGS :=
3+
4+
PIP := $(or \
5+
$(shell command -v pipx 2>/dev/null), \
6+
$(shell command -v pip3 2>/dev/null), \
7+
$(shell command -v pip 2>/dev/null) \
8+
)
9+
ifndef PIPX
10+
PIP_INSTALL_ARGS := --upgrade --user
11+
else
12+
PIP_INSTALL_ARGS := --force ${PIPX_INSTALL_ARGS}
13+
endif
14+
15+
.PHONY: help
16+
.DEFAULT: help
17+
.SILENT: help
18+
help:
19+
echo "Usage: make <target>"
20+
echo "Available targets:"
21+
echo " install to install cloe-launch locally"
22+
echo " editable to install cloe-launch locally in editable mode"
23+
24+
.PHONY: install editable
25+
install:
26+
command -v ${PIP} >/dev/null 2>&1
27+
mv pyproject.toml pyproject.toml.bak
28+
${PIP} install ${PIP_INSTALL_ARGS} . || ( \
29+
mv pyproject.toml.bak pyproject.toml; \
30+
exit 1; \
31+
)
32+
mv pyproject.toml.bak pyproject.toml
33+
34+
editable:
35+
command -v ${PIP} >/dev/null 2>&1
36+
mv pyproject.toml pyproject.toml.bak
37+
${PIP} install -e ${PIP_INSTALL_ARGS} . || ( \
38+
mv pyproject.toml.bak pyproject.toml; \
39+
exit 1; \
40+
)
41+
mv pyproject.toml.bak pyproject.toml

0 commit comments

Comments
 (0)