You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
358 B
Makefile
13 lines
358 B
Makefile
JSON = bookmarks.json
|
|
|
|
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
|
$(eval $(ARGS):;@:)
|
|
|
|
insert:
|
|
cat $(JSON) | jq -r '.links |= . + [{"title": "$(ARGS)", "url": "https://$(ARGS)"}]' | tee $(JSON).new
|
|
mv $(JSON).new $(JSON)
|
|
|
|
delete:
|
|
cat $(JSON) | jq 'del(.links[] | select(.title == "$(ARGS)"))' | tee $(JSON).new
|
|
mv $(JSON).new $(JSON)
|