ihsec icon indicating copy to clipboard operation
ihsec copied to clipboard

It doesn't work.

Open a-berg opened this issue 5 years ago • 3 comments

Dunno if I have misread the instructions but basically I have put 3 configs inside ~/.ihsec (including one that is a symlink to the git repo I use for my emacs config and one installed from github via ihsec install) and after doing ihsec set XXX the folder .emacs.d just has a link to the folder in .ihsec/XXX. Is this the intended use? Because Emacs is unable to find init.el if it's not directly inside .emacs.d.

I'm using GNU Emacs 26.3 @ Pop! OS 20.10 (which in itself is basically very close to ubuntu 20.10)

a-berg avatar Jan 31 '21 14:01 a-berg

I think it's a matter of how ln works. I'm a bit of a noob, but by doing

ln ln -s "$CONFIGS_DIR/$2/.*" $EMACSDIR
                         ^^^

it works. If you confirm that this doesn't break anything I can make a PR.

a-berg avatar Feb 01 '21 08:02 a-berg

I ran into the same problem on my Mac.

I believe the expected behavior is to change the regular directory ~/.emacs.d/ into a symbolic directory link that points to ~/.ihsec/foobar/.

The observed behavior, as stated above, is that a symbolic link to ~/.ihsec/foobar/, called foobar, is put inside of the ~/.emacs.d/, which doesn't work.

I tried the script change proposed by @a-berg but it didn't work for me. Not sure why. I'm not great with bash scripting either.

I imagine the bug fix for this would involve some permutation of the ln command that changes the existing source directory into a symbolic link, but, again, I am not savvy enough with bash scripting (yet) to know what that solution would be.

One workaround that you can do without changing the script is to remove the ~/.emacs.d/ directory prior to running the command. Although this still has some problems, such as the arrow appearing next to all entries in the output for ihsec list, instead of only showing an arrow next to the current configuration.

I might play around with it a bit more. @daedreth are you still maintaining this repo? Doesn't look like you have had activity in a while. If so, I will investigate and make a pull request. If not, I will just tweak my own version. Thanks.

lkcampbell avatar Feb 24 '21 21:02 lkcampbell

Agreed.

NOTE: Do the following at your own risk and make sure you backup your Emacs config on a Git repo if necessary.

Just tried out 'ihsec' and the only way to truly make it work the first time is to delete your contents of '~/.emacs.d'. Afterwards, it was pretty easy to just grab peoples' Emacs configs from GitHub to test them out. Kind of fun, and still a very useful package.

Would be cool if someone made an actual MELPA package with a Helm style mode to just swap stuff on the fly but I guess you would need a baseline config for something like that too to keep it consistent. The choice to use Bash in that sense actually makes a ton sense with this in mind.

SamuelBanya avatar May 13 '22 04:05 SamuelBanya