Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to specify where the cloned repo will be placed #80

Closed
sanbor opened this issue Jun 7, 2013 · 4 comments · Fixed by #92
Closed

Allow to specify where the cloned repo will be placed #80

sanbor opened this issue Jun 7, 2013 · 4 comments · Fixed by #92
Assignees

Comments

@sanbor
Copy link

sanbor commented Jun 7, 2013

It's important to consider the following situation in the current implementation:

fresh bbatsov/prelude . --file=~/.emacs.d/
rm -rf ~/.fresh/build/emacs.d/personal
ln -s ~/.dotfiles/emacs/personal ~/.fresh/build/emacs.d/personal
ln -s ~/.dotfiles/emacs/prelude-conf/prelude-modules.el ~/.fresh/build/prelude-modules.el

This won't work because the cloned repository is in ~/.fresh/build.new until the fresh command ends, so the symbolic links won't work.

Because that is important to have a --location argument.

Maybe it's against fresh philosophy to have things outside .fresh dir, but I would like to do something like:

fresh bbatsov/prelude . --location=~/.prelude --file=~/.emacs.d/ --writable
ln -s ~/.dotfiles/emacs/personal ~/.prelude/personal
ln -s ~/.dotfiles/emacs/prelude-conf/prelude-modules.el ~/.prelude/prelude-modules.el

--location is the place where the cloned repo will be placed
--file is where the link will be placed
--writable indicates that is ok to make changes in that repository

If the writable option is specified, then fresh should just do git pull instead of rewriting the whole directory.

@sanbor
Copy link
Author

sanbor commented Jun 10, 2013

I like your solution! What about doing git pull in the repo during fresh update when was defined with a --writable option? Or maybe another flag, like --keep-files

@jasoncodes
Copy link
Member

I see the potential for a feature which symlinks direct out of ~/.fresh/source. --writable is not what it would be called (this is something else). Perhaps something along the lines of --direct? It would only work with --file. Naming suggestions welcome.

With fresh_after_build this new feature could easily be faked. Add a dummy fresh bbatsov/prelude README.md --file=prelude-keep line which refers to the repo you care about will keep it from being removed by fresh clean. You could then use fresh_after_build to link directly to the source repo with ln -sf ~/.fresh/source/bbatsov/prelude ~/.emacs.d, followed by any other symlinks you wish to make out of ~/.dotfiles.

twe4ked added a commit that referenced this issue Sep 13, 2013
@ghost ghost assigned twe4ked Sep 13, 2013
twe4ked added a commit that referenced this issue Sep 16, 2013
@twe4ked
Copy link
Member

twe4ked commented Sep 20, 2013

@sanbor I forgot to comment on this the other day. We added the fresh_after_build callback, let us know how it goes!

@sanbor
Copy link
Author

sanbor commented Oct 31, 2013

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants