GithubHelp home page GithubHelp logo

Comments (13)

anishathalye avatar anishathalye commented on August 17, 2024

Hmm, that's a good point.

Do you think we could have an option like relink: true for overwriting symlinks but not deleting files (so no data loss)? And then the force: true could stay how it is -- it'll remove the file (or link) if necessary. How does this sound?

Default behavior is a little bit more tricky. I definitely agree with you that it'll be a great thing to have, I'm just not sure what's the right interface. Should it go in the config file itself? With the current YAML/JSON format, I'm not sure where that would go. Should it be a command line option? I feel like that might get messy.

Do you have any ideas?

from dotbot.

Ploppz avatar Ploppz commented on August 17, 2024

relink is a good idea. A suggestion for setting defaults is to put this in the same .yaml file as everything else:

- default:
     force: true

from dotbot.

anishathalye avatar anishathalye commented on August 17, 2024

relink should be doable.

Currently, the YAML file is declarative.

Adding something like this seems out of place:

- default:
  force: true

Because the "default" is not another action to be executed.

Maybe something like this could be better:

defaults:
  link:
    force: true
  shell:
    stdout: true

config:
  - link:
      ~/.vimrc: vimrc
  - shell:
    - echo hi

But I'm not super happy with that either.

from dotbot.

Ploppz avatar Ploppz commented on August 17, 2024

Yes that works. One more suggestion that gets rid of two supergroups defaults and config:

- link:
    default:
        force: true
    ~/.vimrc: vimrc

Or maybe that has the potential to crash with a file "default" - maybe - default instead. I don't know so much about yaml syntax. Well that's a suggestions and I'll leave it up to you to decide what you want to do :)

from dotbot.

anishathalye avatar anishathalye commented on August 17, 2024

Yeah, you're right, that has the potential to clash with the file default. In that context, - default is not actually valid YAML.

from dotbot.

anishathalye avatar anishathalye commented on August 17, 2024

relink functionality implemented! (3725d21)

The default configuration syntax might have to wait until Dotbot 2.0 (unless someone comes up with a nice way to integrate it into the current design).

from dotbot.

Ploppz avatar Ploppz commented on August 17, 2024

Hm, it says that it only overrides broken symbolic links. Unless I'm misunderstanding something: What I would need is to override any symbolic link, because my case may be like this:

. (dotfiles directory)
├── dircolors-green
└── dircolors-plumb

And then I would have green.yaml and plumb.yaml which would link .config/dircolors to dotfiles/dircolors-green and dotfiles/dircolors-plumb respectively.

I would say that this behaviour is not destructive, as a symbolic link in itself does not hold a lot of information - there shouldn't be any consequences in most cases.

from dotbot.

anishathalye avatar anishathalye commented on August 17, 2024

Perhaps my commit message wasn't the best. It does overwrite broken and incorrect symbolic links, behaving the way you described.

from dotbot.

Ploppz avatar Ploppz commented on August 17, 2024

Ah yes indeed, I think I just misunderstood words. Thanks for implementing it. And sorry for this late reply - this is the first time I actually come back to my dotfiles for a while.

I have a problem: I pulled the latest version; my HEAD is now at commit 53c26ba: "Clean up code". I have a lot of links defined like this:

    ~/.config/theme:
        path: theme-green/
        relink: true

But I still get the Incorrect link error on all of them. I'm wondering if I didn't update dotbot correctly. I went into the dotbot directory and wrote git pull origin master.

from dotbot.

anishathalye avatar anishathalye commented on August 17, 2024

What's happening is that the Dotbot install script fetches the version of Dotbot that's committed in git. To update to a newer version of Dotbot, run:

git submodule update --init --remote dotbot && git add dotbot

After this, running ./install should work just fine (and then once you check, you can commit the change to your dotfiles).

from dotbot.

Ploppz avatar Ploppz commented on August 17, 2024

@anishathalye How is it going with default configuration and Dotbot 2.0?

from dotbot.

anishathalye avatar anishathalye commented on August 17, 2024

Haven't started on it yet.

from dotbot.

Ploppz avatar Ploppz commented on August 17, 2024

Alright. No hurries.

from dotbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.