Comments (13)
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.
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.
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.
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.
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.
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.
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.
Perhaps my commit message wasn't the best. It does overwrite broken and incorrect symbolic links, behaving the way you described.
from dotbot.
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.
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.
@anishathalye How is it going with default configuration and Dotbot 2.0?
from dotbot.
Haven't started on it yet.
from dotbot.
Alright. No hurries.
from dotbot.
Related Issues (20)
- fatal: not a git repository: HOT 3
- Some files are not uploading properly
- How to add exclusion HOT 1
- `if` with shell function satisfying interface
- Hardlink support HOT 4
- Inclusion list HOT 2
- Trying to link a file from a submodule into a subdirectory of a directory managed by dotbot HOT 1
- Drop support for python 2.7 HOT 6
- All plugins using sub-directives implemented with Dispatcher broken HOT 3
- Installing dotbot via python fails HOT 6
- Wheel distribution on pypi doesn't pass the tests since it's missing some files under the tests/ directory HOT 4
- New feature: copy/initialize a file instead of linking
- Duplicate directives when custom plugins import builtins
- How to remove dotbot and restore all symlinks HOT 1
- broken `pyyaml` submodule HOT 2
- Accidental file deletion when linking
- A more descriptive error message for link error HOT 3
- Suggestion for Improved Documentation
- install abends if config yaml uses 2 spaces for indentation HOT 5
- Tests fail because the mocking strategy conflicts with pytest on Nixos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotbot.