add option to keep projects in nested directories
I personally like keeping my projects in a nested directory.
For example, if I'm working on a project foo, then the git repo would be cloned at ~/dev/foo/foo.
With this structure, I can keep additional things needed (such as testing environments) for foo in the outer foo directory, without interfering with the repo.
However, fw doesn't seem to support this. It would be really awesome to have this, as fw currently wouldn't work with some of my projects for that reason.
I am aware that it is possible to do this by setting override_path, but it is really annoying doing this for every project, instead of it defaulting to that path when using the add command.
I think this is related to https://github.com/brocode/fw/issues/23 @mriehl any other ideas?
Yeah, it seems to be related, if #23 were implemented that should fix my issue.
Yeah I also agree this is something #23 could tackle (along with a slew of other customizations). I guess there is a workaround where you can "implement" your logic in a shell alias, by saying something like:
/usr/bin/fw-add-nested:
#!/bin/bash
REMOTE=${1:?"Usage: $0 <git remote>"}
NAME=$(echo "$REMOTE" | cut -d "/" -f2 | tr -d ".git")
fw add "$REMOTE" --override-path "/tmp/$NAME/$NAME"
and then you can just do fw-add-nested [email protected]:foo/bar.git
It isn't the sexiest but that would work with unlimited flexibility today and we won't break CLI backwards compatibility especially in the case of something like fw add.
This breaks fw sync.
On Mon, Jun 14, 2021, at 07:07, Maximilien Riehl wrote:
Yeah I also agree this is something #23 https://github.com/brocode/fw/issues/23 could tackle (along with a slew of other customizations). I guess there is a workaround where you can "implement" your logic in a shell alias, by saying something like:
/usr/bin/fw-add-nested:
`#!/bin/bash
REMOTE=${1:?"Usage: $0
fw add "$REMOTE" --override-path "/tmp/$NAME/$NAME" `
and then you can just do
fw-add-nested ***@***.***:foo/bar.git
It isn't the sexiest but that would work with unlimited flexibility today and we won't break CLI backwards compatibility especially in the case of something like fw add.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/brocode/fw/issues/187#issuecomment-860365504, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADCFBD2L6AZSJRKHPO6DVLTSWFAXANCNFSM46RN6IQA.
@bomgar what do you mean it breaks fw sync? It's basically just a project with override path. Do you mean there's a mkdir -p missing somewhere in the sync code because the parent dir basically doesn't exist?
A sorry I should no reply to threads after waking up.
@LordMZTE is the workaround working for you? Or are you planning on working on the issue yourself? Or should we implement something if we decide what to do and have the time to implement it?
I haven't tried the workaround yet, but once we decide what to do in #23 I'd be happy to contribute!