Do not apply migration is there is no ~/.emacs.d/.emacs-ver file.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Fri, 01 Jan 2021 21:34:09 +0200
changeset 1664 72275301c19d
parent 1663 a0494ee73d5f
child 1665 3685e2321a9b
Do not apply migration is there is no ~/.emacs.d/.emacs-ver file.
Makefile
--- a/Makefile	Fri Jan 01 20:39:48 2021 +0200
+++ b/Makefile	Fri Jan 01 21:34:09 2021 +0200
@@ -126,14 +126,11 @@
 .PHONY: upgrade
 upgrade:
 	\
-if [ -f $(COMPAT_FILE) ]; then \
-  read ver <$(COMPAT_FILE); \
-  if [ "$$ver" -gt $(COMPAT_VER) ]; then \
-    echo "*** "Project is too old, downgrade is not possible..." ***"; \
-    exit 1; \
-  fi; \
-else \
-  ver=0; \
+[[ -f $(COMPAT_FILE) ]] || exit 0; \
+read ver <$(COMPAT_FILE); \
+if [[ "$$ver" -gt $(COMPAT_VER) ]]; then \
+  echo "*** "Project is too old, downgrade is not possible..." ***"; \
+  exit 1; \
 fi; \
 for ((i=ver+1; i <= $(COMPAT_VER); i++)); do \
   $(SHELL) upgrade/$$i.bash; \