Commit e8c96c80 authored by Pierre Balaye's avatar Pierre Balaye

Auto spacemacs configuration with configs dir contents

parent 1b2cced3
...@@ -9,7 +9,7 @@ mefs_indent_message () { ...@@ -9,7 +9,7 @@ mefs_indent_message () {
export mefs_THISREPODIR=`pwd` export mefs_THISREPODIR=`pwd`
export mefs_CHEMACSDIR="$mefs_EMACSDIR/chemacs" export mefs_CHEMACSDIR="$mefs_EMACSDIR/chemacs"
export mefs_FLAVORDIR="$mefs_EMACSDIR/flavors" export mefs_FLAVORDIR="$mefs_EMACSDIR/flavors"
export mefs_CONFIGDIR="$mefs_FLAVORDIR/configs" export mefs_CONFIGDIR="$mefs_EMACSDIR/configs"
export -f mefs_indent_message export -f mefs_indent_message
./01-create-dirs.sh ./01-create-dirs.sh
......
#!/bin/bash #!/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) mefs_CONFIGS=$(ls $mefs_CONFIGDIR | grep spacemacs)
for conf in $mefs_CONFIGS for conf in $mefs_CONFIGS
do do
mefs_indent_message "Creating dir for $conf" mefs_indent_message "Creating dir for $conf..."
[ -d ${mefs_FLAVORDIR}/${conf} ] || [ -d ${mefs_FLAVORDIR}/${conf} ] ||
cp -r $mefs_FLAVORDIR/spacemacs-develop ${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 done
( (
("vanilla" . ((user-emacs-directory . "~/emacs/configs/vanilla"))) ("vanilla" . ((user-emacs-directory . "~/emacs/configs/vanilla")))
("default" . ((user-emacs-directory . "~/emacs/configs/spacemacs-default") ("doom" . ((user-emacs-directory . "~/emacs/flavors/doom")
(env . (("SPACEMACSDIR" . "~/emacs/flavors/spacemacs-default.d"))))) (env . (("DOOMDIR" . "~/emacs/configs/doom")))))
("minimal" . ((user-emacs-directory . "~/emacs/configs/spacemacs-minimal") ;; SPACEMACS MULTIPLE CONFIGURATIONS STARTS HERE
(env . (("SPACEMACSDIR" . "~/emacs/flavors/spacemacs-minimal.d"))))) ("spacemacs-test/" . ((user-emacs-directory . "~/emacs/flavors/spacemacs-test/")
("test" . ((user-emacs-directory . "~/emacs/configs/spacemacs-test") (env . (("SPACEMACSDIR" . "~/emacs/configs/spacemacs-test/")))))
(env . (("SPACEMACSDIR" . "~/emacs/flavors/spacemacs-test.d"))))) ("spacemacs-minimal/" . ((user-emacs-directory . "~/emacs/flavors/spacemacs-minimal/")
("doom" . ((user-emacs-directory . "~/emacs/flavors/doom-27") (env . (("SPACEMACSDIR" . "~/emacs/configs/spacemacs-minimal/")))))
(env . (("DOOMDIR" . "~/emacs/configs/doom-27.d"))))) ("spacemacs-default/" . ((user-emacs-directory . "~/emacs/flavors/spacemacs-default/")
(env . (("SPACEMACSDIR" . "~/emacs/configs/spacemacs-default/")))))
;; SPACEMACS MULTIPLE CONFIGURATIONS ENDS HERE
) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment