CodelyTV / dotly

🌚 Modular and easy to customize dotfiles framework
https://codely.com/cursos
MIT License
1.2k stars 117 forks source link

zimfw does not allow to install github's modules #224

Open bertuz opened 2 years ago

bertuz commented 2 years ago

I use my own zim theme forked by ZIM's oblong, and in order to use it I used to add it to my modules and execute zimfw uninstall && zimfw install.

This used to work before installing dotly. Now, adding a github module the way is documented here does not work:

cat zimrc:

[...]
zmodule https://github.com/bertuz/oblong.git -n oblong
mbertamini@MacTeo ~ % zimfw uninstall && zimfw install
x /Users/mbertamini/.zimrc:8:oblong: /Users/mbertamini/.dotfiles/shell/zsh/.zim/modules/oblong not found
Failed to source /Users/mbertamini/.zimrc

I don't know if it's because the zim version dotly adopts, I've been using way too little time dotly to dig further more into this right now 😅. is it maybe because the way the submodules are set?

the workaround is copying the module myself, but I'd loose the chance of upgrading the module automatically

gtrabanco commented 2 years ago

Yes, Not sure but maybe your dotfiles are older to the PR #192

Currently zimfw is installed in its own folder instead of use it as submodule. Try by uninstalling zimfw submodule, upgrade dotly and execute dot self install.

Uninstall submodule

submodule="modules/zimfw"
cd "$DOTFILES_PATH"
git submodule deinit -f -- "$submodule"
git rm -f "$submodule"
git commit -m "Removed submodule '$submodule'"
rm -rf ".git/modules/${submodule}"
echo "Submodule '${submodule}' uninstalled"

Upgrade Dotly

Make sure you commit a changes to a new branch if you have changes of your Dotly.

cd "$DOTLY_PATH"
git push --set-upstream origin main
git reset --hard HEAD
git fetch -ap
git pull main

Now it is time to execute:

dot self install
bertuz commented 2 years ago

mmh 🤔 I think I didn't have it install as a submodule, but after dot-self install, I got it back working! Now zim installs it by cloning it, good! But... I bumped into another similar issue: now when I run zimfw uninstall && zimfw install, zim installs .zim/modules/zsh-autosuggestions. so far so good. The problem is that it looks as a submodule that dotly doesn't handle good:

â—¼ .dotfiles / $ git status                                                                                                                               130
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)
    modified:   shell/zsh/.zim/modules/zsh-autosuggestions (untracked content)

I don't know if I should git-ignore it or I should add it as a submodule and embrace it 🤔

â—¼ .dotfiles / $ git submodule                                                                                                                                              
 76ad4498c37ef61cddd59ec641936142c8de9df5 modules/dotly (v0.1-207-g76ad449)
fatal: no submodule mapping found in .gitmodules for path 'shell/zsh/.zim/modules/completion'
gtrabanco commented 2 years ago

@rgomezcasas I solved this on my fork by installing zimfw with a recipe which is called in dot self install by modifying package library to enable installations from scripts package::install and registry::install (I add the libraries link at the bottom) and I install zim in its own folder as suggested with #192 (see the recipe here). Are you open to modify Dotly to handle packages in the same way as my fork?

Offtopic: With these libraries I also modify how update, dump and import works to be also in the "package manager" library.

gtrabanco commented 2 years ago

mmh 🤔 I think I didn't have it install as a submodule, but after dot-self install, I got it back working! Now zim installs it by cloning it, good! But... I bumped into another similar issue: now when I run zimfw uninstall && zimfw install, zim installs .zim/modules/zsh-autosuggestions. so far so good. The problem is that it looks as a submodule that dotly doesn't handle good:

â—¼ .dotfiles / $ git status                                                                                                                               130
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)
  modified:   shell/zsh/.zim/modules/zsh-autosuggestions (untracked content)

I don't know if I should git-ignore it or I should add it as a submodule and embrace it 🤔

â—¼ .dotfiles / $ git submodule                                                                                                                                              
 76ad4498c37ef61cddd59ec641936142c8de9df5 modules/dotly (v0.1-207-g76ad449)
fatal: no submodule mapping found in .gitmodules for path 'shell/zsh/.zim/modules/completion'

Add to .gitignore shell/zsh/.zim. Maybe this folder should be on a default .gitignore in the dotfiles_template

bertuz commented 2 years ago

and I install zim in its own folder as suggested with #192

key-important making any zim module we install with zimfw compatible with dotly, otherwise we fill the repo with unwanted submodules to cope with each time we commit-push our dotfiles! Makes sense, thanks

@rgomezcasas I'd say this is a feature everybody needs 😉