upgrade/2.bash
author Oleksandr Gavenko <gavenkoa@gmail.com>
Tue, 20 Sep 2022 00:16:01 +0300
changeset 1759 1bbd7898cc9b
parent 1666 06937ff1ec5f
permissions -rw-r--r--
Ported Makefile to MSYS2: Emacs is native here and cannot deal with MSYS2-style paths.

#!/bin/bash

set -x -e

emacsdir=~/.emacs.d
compatfile=$emacsdir/.emacs-ver
mylispdir_old=$emacsdir/my
mylispdir_new=$emacsdir/mylisp

if ! [[ -f $compatfile ]]; then
    echo 'Cannot detect compatibility.'
    exit 1
fi
read ver <$compatfile
if [[ $ver != 1 ]]; then
  echo 'Script is designed only for upgrade: v1 => v2.'
  exit 1
fi

rm $mylispdir_old/init.el || :
mv $mylispdir_old $mylispdir_new || :
rm $emacsdir/.emacs-my.elc || :

echo 2 >$compatfile