Skip to content
Snippets Groups Projects
Commit e8c96c80 authored by Pierre Balaye's avatar Pierre Balaye
Browse files

Auto spacemacs configuration with configs dir contents

parent 1b2cced3
Branches
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ mefs_indent_message () {
export mefs_THISREPODIR=`pwd`
export mefs_CHEMACSDIR="$mefs_EMACSDIR/chemacs"
export mefs_FLAVORDIR="$mefs_EMACSDIR/flavors"
export mefs_CONFIGDIR="$mefs_FLAVORDIR/configs"
export mefs_CONFIGDIR="$mefs_EMACSDIR/configs"
export -f mefs_indent_message
./01-create-dirs.sh
......
#!/bin/bash
mefs_indent_message "Multiple spacemacs..."
mefs_BEG_PATTERN="SPACEMACS MULTIPLE CONFIGURATIONS STARTS HERE"
mefs_END_PATTERN="SPACEMACS MULTIPLE CONFIGURATIONS ENDS HERE"
mefs_TEMPLATE1='("<conf>" . ((user-emacs-directory . "~/emacs/flavors/<conf>")'
mefs_TEMPLATE2='(env . (("SPACEMACSDIR" . "~/emacs/configs/<conf>")))))'
sed -i "/$mefs_BEG_PATTERN/,/$mefs_END/{/;;/!d}" dot.emacs-profiles.el
mefs_CONFIGS=$(ls $mefs_CONFIGDIR | grep spacemacs)
for conf in $mefs_CONFIGS
do
mefs_indent_message "Creating dir for $conf"
mefs_indent_message "Creating dir for $conf..."
[ -d ${mefs_FLAVORDIR}/${conf} ] ||
cp -r $mefs_FLAVORDIR/spacemacs-develop ${mefs_FLAVORDIR}/${conf}
mefs_indent_message "Adding emacs profile for $conf..."
echo "${mefs_TEMPLATE//<conf>/$conf/}"
sed -i "/$mefs_BEG_PATTERN/a ${mefs_TEMPLATE2//<conf>/$conf/}" dot.emacs-profiles.el
sed -i "/$mefs_BEG_PATTERN/a ${mefs_TEMPLATE1//<conf>/$conf/}" dot.emacs-profiles.el
done
(
("vanilla" . ((user-emacs-directory . "~/emacs/configs/vanilla")))
("default" . ((user-emacs-directory . "~/emacs/configs/spacemacs-default")
(env . (("SPACEMACSDIR" . "~/emacs/flavors/spacemacs-default.d")))))
("minimal" . ((user-emacs-directory . "~/emacs/configs/spacemacs-minimal")
(env . (("SPACEMACSDIR" . "~/emacs/flavors/spacemacs-minimal.d")))))
("test" . ((user-emacs-directory . "~/emacs/configs/spacemacs-test")
(env . (("SPACEMACSDIR" . "~/emacs/flavors/spacemacs-test.d")))))
("doom" . ((user-emacs-directory . "~/emacs/flavors/doom-27")
(env . (("DOOMDIR" . "~/emacs/configs/doom-27.d")))))
("doom" . ((user-emacs-directory . "~/emacs/flavors/doom")
(env . (("DOOMDIR" . "~/emacs/configs/doom")))))
;; SPACEMACS MULTIPLE CONFIGURATIONS STARTS HERE
("spacemacs-test/" . ((user-emacs-directory . "~/emacs/flavors/spacemacs-test/")
(env . (("SPACEMACSDIR" . "~/emacs/configs/spacemacs-test/")))))
("spacemacs-minimal/" . ((user-emacs-directory . "~/emacs/flavors/spacemacs-minimal/")
(env . (("SPACEMACSDIR" . "~/emacs/configs/spacemacs-minimal/")))))
("spacemacs-default/" . ((user-emacs-directory . "~/emacs/flavors/spacemacs-default/")
(env . (("SPACEMACSDIR" . "~/emacs/configs/spacemacs-default/")))))
;; SPACEMACS MULTIPLE CONFIGURATIONS ENDS HERE
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment