Browse Source

Initial commit

Adam Rutkowski 3 years ago
commit
d6396c5255
2 changed files with 39 additions and 0 deletions
  1. 39 0
      Makefile
  2. 0 0
      silos/.silos

+ 39 - 0
Makefile

@@ -0,0 +1,39 @@
+.PHONY: all fill unload withdraw save
+
+check_defined = \
+    $(foreach 1,$1,$(__check_defined))
+__check_defined = \
+    $(if $(value $1),, \
+      $(error Expected $1$(if $(value 2), ($(strip $2)))))
+
+all: silos
+	@git status
+
+silos:
+	@mkdir silos
+	@touch silos/.silos
+	@git init .
+	@git add silos/.silos
+	@git commit silos -m "Initial commit"
+
+fill: silos
+	$(call check_defined, what)
+	$(call check_defined, into)
+	@echo "Filling silo $(into) with $(what)..."
+	@mkdir -p silos/$(into)
+	mv -vi $(what) silos/$(into)
+
+unload: silos
+	@echo "Unloading $(silo)..."
+	$(call check_defined, silo)
+	@cd silos && stow -S -v $(silo) -t $(HOME) && cd -
+
+withdraw: silos
+	$(call check_defined, silo)
+	@echo "Withdrawing $(silo)..."
+	@cd silos && stow -D -v $(silo) -t $(HOME) && cd -
+
+save: silos/$(silo)
+	$(call check_defined, silo)
+	@echo "Saving $(silo)..."
+	git add silos/$(silo) && git commit silos/$(silo) -m "Update $(silo)"

+ 0 - 0
silos/.silos