anishathalye / dotbot

A tool that bootstraps your dotfiles ⚡️
MIT License
6.91k stars 288 forks source link

Action link not handled error #287

Open Daniele-Tentoni opened 2 years ago

Daniele-Tentoni commented 2 years ago

Hi all, I'm using this tool for the first time and I'm trying to configure my first dotfile repo.

First of all, I have created a new repo with 2 simple dot files.

I've installed dotbot as a git submodule and created a very simple install.conf.yaml file.

Then I tried to run install script, that produced this output:

dotfiles % ./install

Submodule 'lib/pyyaml' (https://github.com/yaml/pyyaml) registered for path 'dotbot/lib/pyyaml'
Cloning into '/Users/d.tentoni/work/dotfiles/dotbot/lib/pyyaml'...
Submodule path 'dotbot/lib/pyyaml': checked out '2f463cf5b0e98a52bc20e348d1e69761bf263b86'
An error was encountered while executing action link
Action link not handled
An error was encountered while executing action clean
Action clean not handled
An error was encountered while executing action link
Action link not handled
Action ~/.zshrc not handled
An error was encountered while executing action shell
Action shell not handled

==> Some tasks were not executed successfully

Where I'm wrong? I already have a .zshrc file, but I've used the force: true flag in conf.yaml file.

anishathalye commented 2 years ago

Hi, I can't see your install.conf.yaml file. Is that linking to a private repo by any chance? If you're comfortable sharing publicly, could you upload the file directly in this issue, or if you're comfortable sharing only privately, email it to me?

It's most likely a syntax error in the yaml file.

anishathalye commented 2 years ago

You can also run ./install -v for more verbose output.

Daniele-Tentoni commented 2 years ago

Thank you @anishathalye, sorry for the private repo inconvenience. Now it's public. This is my command output:

dotfiles % ./install -v
An error was encountered while executing action link
'bool' object has no attribute 'startswith'
Action link not handled
An error was encountered while executing action clean
'NoneType' object has no attribute 'get'
Action clean not handled
An error was encountered while executing action link
'NoneType' object has no attribute 'get'
Action link not handled
Action ~/.zshrc not handled
An error was encountered while executing action shell
'NoneType' object has no attribute 'get'
Action shell not handled

==> Some tasks were not executed successfully
anishathalye commented 2 years ago

The indentation in the YAML isn't quite right, which is breaking the nesting structure. Try this: https://gist.github.com/anishathalye/0809bb6e34513ae43cead249974dc4b2

Btw, you can use a tool like https://www.json2yaml.com/ to see how your YAML will get parsed.

Daniele-Tentoni commented 2 years ago

Thank you @anishathalye , now my script work well. Is possible to implement a check that throw an error if the yaml file is not well indented? Is possible to check the indentation before the install script execution?

anishathalye commented 2 years ago

That is a good idea, it should be able to add some level of Dotbot-specific syntax checking. Dotbot already gives a reasonable error message if the config file is not valid YAML, but we should be able to do better than that. I'll keep this issue open to track this syntax checking idea.