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

add option to keep projects in nested directories #187

Open
LordMZTE opened this issue Jun 11, 2021 · 9 comments
Open

add option to keep projects in nested directories #187

LordMZTE opened this issue Jun 11, 2021 · 9 comments

Comments

@LordMZTE
Copy link
Contributor

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.

@LordMZTE
Copy link
Contributor Author

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.

@bomgar
Copy link
Member

bomgar commented Jun 12, 2021

I think this is related to #23
@mriehl any other ideas?

@LordMZTE
Copy link
Contributor Author

Yeah, it seems to be related, if #23 were implemented that should fix my issue.

@mriehl
Copy link
Member

mriehl commented Jun 14, 2021

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.

@bomgar
Copy link
Member

bomgar commented Jun 14, 2021 via email

@mriehl
Copy link
Member

mriehl commented Jun 14, 2021

@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?

@bomgar
Copy link
Member

bomgar commented Jun 14, 2021

A sorry I should no reply to threads after waking up.

@bomgar
Copy link
Member

bomgar commented Jun 14, 2021

@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?

@LordMZTE
Copy link
Contributor Author

I haven't tried the workaround yet, but once we decide what to do in #23 I'd be happy to contribute!

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

No branches or pull requests

3 participants