-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (44 loc) · 1.16 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.PHONY: build help fetch read add list export clear
build:
docker build --tag gust --file Dockerfile .
help:
docker run --rm gust
# or
# cargo run -- -h
fetch:
@if [ -z "$(url)" ]; then \
echo "Please provide a URL using 'make fetch url=<your_url_here>'"; \
else \
docker run --rm -v gust:/app gust fetch --url "$(url)"; \
fi
read:
@if [ -z "$(recipe)" ]; then \
docker run --rm -v gust:/app gust read recipes; \
else \
docker run --rm -v gust:/app gust read --recipe "$(recipe)"; \
fi
add:
@if [ -z "$(recipe)" ]; then \
echo "Please provide a recipe name using 'make add recipe=<your_recipe_here>'"; \
else \
docker run --rm -v gust:/app gust add list --recipe "$(recipe)"; \
fi
list:
docker run --rm -v gust:/app gust read list
export:
if [ ! -f "$(PWD)/items.yaml" ]; then \
echo "Error: items.yaml not found in $(PWD)."; \
exit 1; \
fi
if [ ! -f "$(PWD)/list.yaml" ]; then \
echo "Error: list.yaml not found in $(PWD)."; \
exit 1; \
fi
docker run --rm \
-v gust_data:/app \
-v $(PWD)/items.yaml:/app/items.yaml \
-v $(PWD)/list.yaml:/app/list.yaml \
gust \
export
clear:
docker run --rm -v gust:/app gust update list clear