mdespuits / dotify

A CLI Tool for managing your dotfiles.
http://mattdbridges.github.com/dotify
MIT License
158 stars 10 forks source link

Specifying paths for linking file/directory contents? #4

Closed bluestrike2 closed 4 years ago

bluestrike2 commented 12 years ago

Really impressed with dotify. Significantly better solution than some of the others I've seen (and much better than the nightmare I used for myself). Didn't want to get too far into the idea before running it past you, but thoughts on being able to specify paths for files/directories?

Use case. Let's say I'm storing a bunch of zsh files in a subdirectory like so for simplifying management (lots of dotfiles):

~/.dotify/zsh/**
~/.dotify/zsh/**
~/.dotify/foo/**

Those files in zsh are eventually going to be linked directly into the home directory, i.e. ~/.dotify/zsh/zlogin >> ~/.zlogin" but being able to keep them separated in my~/.dotifydirectory is still nevertheless a huge productivity boon when you're dealing with more than just one or two dotfiles. I was thinking a simple setting in.dotrc``` ought to be sufficient:

dotify_contents_to_root:
  - zsh
  - vim
  - git
  - misc

Any directories in the list would just have their contents linked directly to home root. Corollary might be an option might be for linking whole directories, ala something like this:

dotify_directory:
  - dir1
  - dir2

Anyhow, I was planning on implementing something similar to the first on my fork but wanted to ask and see if you had any thoughts/were planning on something similar before I jumped the gun, so to speak.

mdespuits commented 12 years ago

@bluestrike2 I'm glad you like it. I had the same experience and was running into the same issue of not finding a good solution to manage all the things. I was working on a solution for my own that was actually fairly modular and customizable (see my old dotfiles) but writing a gem to handle all this seemed to be a much better idea.

It took me a little bit to follow your exact use case. I had not planned on implementing anything like that, but I think that it would be a useful addition to the gem, however I am doing some heavy work on it right now due to the fact that the Dotify::CLI class is entirely untested and needs some coverage. If you want to 'jump the gun', go right ahead.

I look forward to your contributions!

bluestrike2 commented 12 years ago

The difficulty following was definitely my fault; rereading the earlier message, my use case was a touch... convoluted. The general idea is actually a heck of a lot simpler than I might have implied.

Anyhow, I'll sit down some point tomorrow and work out the idea. Keep up the solid work with dotify.

mdespuits commented 12 years ago

@bluestrike2 As a forewarning, I will be pushing some significant changes to the gem here in the next few days (i.e. complete re-write of much of the internals to be more OO and avoid using primitive types for object interaction). If you are still considering working on contributing your feature, I suggest you wait until I merge these changes into the master feature branch.

bluestrike2 commented 12 years ago

Hi Matt,

Barely even started poking my head into things to be honest. I'll hold off (my dotfiles aren't going anywhere). What I was thinking along these lines were:

Looking forward to seeing what you cook up then I'll move.

mdespuits commented 12 years ago

May I ask what the reason is behind the third one? I'm not sure I see any particular benefit in using that technique.

bluestrike2 commented 12 years ago

Just remembering a conversation with a buddy who was complaining about hidden files (I know...). Not a big deal either way.

mdespuits commented 12 years ago

And one more question. What is your thinking on the dotify_directory option? Is this a way to customize the directory name that Dotify stores all of the files in?

I also think just making the options files_to_root and directory respectively since the configuration is all within Dotify anyway. No need for unnecessary namespacing.

bluestrike2 commented 12 years ago

Naming convention wasn't really clear but dotify_directory was for the idea of linking the contents of a given directory out to root ala ~/.dotify/foo/.bar to ~/.bar.

alexeymorozov commented 12 years ago

I like the idea of linking with prepending a dot too:

~/.dotify/bashrc to ~/.bashrc

Example is here https://github.com/ryanb/dotfiles

mdespuits commented 12 years ago

@rekky Yes, I have had that idea of making that an option. However that is not high priority on my list of things I want to add right at the moment. I would be happy to consider it if you made a pull request with that functionality.

But before you do, I must warn you that I am re-writing the entire CLI class (to become CLI::Base) for better maintainability, readability, and testability. I will hopefully be done with the initial changes within the week, but after that it should be a little quieter in the codebase.

alexeymorozov commented 12 years ago

@mattdbridges Okay, I'll try to implement it after your great merge. :)

Thank you for a creation such a good thing!

mdespuits commented 12 years ago

You are most welcome! It is a privilege working on a project that solves such a simple and common problem.

bluestrike2 commented 12 years ago

Hey Matt,

Looking forward to seeing the changes. Haven't forgotten about dotify. It's the little tools that make life easier, after all :).

mdespuits commented 12 years ago

@rekky There is one issue that would make the "pseudo" dotfile setup in the ~/.dotify directory difficult is the fact that some people (like myself) would like to have other non-dotfile files in there (such as README, CHANGELOG, etc.) to track the history of their development setup. This could potentially throw a wrench in that idea as far as configuration to avoid such typical files, but for now I'm not going to be implementing it that way.

However, @bluestrike2's idea of having subdirectories that map to the root is still a possibility. What are your thoughts of this @rekky?

mdespuits commented 12 years ago

@bluestrike2 @rekky I have not forgotten about these suggestions of yours. I have indeed been doing tons of work on Dotify, though much behind the scenes of branches. This feature will likely be included in the 1.0.0 release of Dotify which is hopefully going to be sooner than later. In it you will be able to specify not just dotfiles, but any other configuration files that you use for development (e.g. Sublime Text 2 json configuration which is my own personal need).