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

Copy folders/files into local workspace #346

Open
mkvlrn opened this issue Dec 29, 2023 · 4 comments
Open

Copy folders/files into local workspace #346

mkvlrn opened this issue Dec 29, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@mkvlrn
Copy link

mkvlrn commented Dec 29, 2023

Is your feature request related to a problem? Please describe.
I want to be able to copy the gist (entire folder strucuture, if there is one) into my local folder. Currently I need to copy the contents of every file and paste into a manually created one.

It was asked in an unanswered Discussion Q&A and there was a possible solution/PR mentioned, but it was never merged.

Describe the solution you'd like
Something like this PR that was closed without being merged because the author decide to mantain a clone of the extension with these changes.

Describe alternatives you've considered
Using said clone extension, but I rather use the official one.

Additional context
N/A

@mkvlrn mkvlrn added the enhancement New feature or request label Dec 29, 2023
@lostintangent
Copy link
Owner

Could you share a bit more detail about the way you'd expect to use this? Syncing files between your local file system and gists is out of scope for this extension, but it could be simple to allow downloading the contents of a gist (and then expecting the user to do any content sync if needed).

@mkvlrn
Copy link
Author

mkvlrn commented Dec 30, 2023

Thank you for the reply!

So for some groups of files I use gitsts instead of repositories because these files are very reusable among all types of repositories I could create, and sometimes I'm just doing some local experimentation without creating a new repository, and grabbing files from a gist is just what I need.

Like this, for example:

I have a gist containing a .vscode folder with a settings.json file in it, and some other boilerplate files outisde that folder, like an .editorconfig and biome.json. It's sort of a template but not fully fleshed out, just parts that I like to plug into a new bun project, or a node project.

gist
|__ .vscode/
|   |__ settings.json
|__ .editorconfig
|__ biome.json

So after starting the project with bun init and some other steps, I want to pull all files from the gist and put them in the root of my project.

Just downloading the gist (with folder structure intact, if possible) to my open workspace would do.

@lostintangent
Copy link
Owner

lostintangent commented Dec 30, 2023

Ah I see, that makes a lot of sense. In your case, it seems like you'd always want to copy the gist files to the root of your currently opened workspace?

To make this more general, I suppose we'd need to check and see if a file already existed, and ask the user if they wanted to overwrite it.

And also, I wonder if we need to ask which directory to download the files to, as opposed to just assuming it's the workspace directory.

@mkvlrn
Copy link
Author

mkvlrn commented Dec 31, 2023

To make this more general, I suppose we'd need to check and see if a file already existed, and ask the user if they wanted to overwrite it.

Oh yes, that could be very handy!

And also, I wonder if we need to ask which directory to download the files to, as opposed to just assuming it's the workspace directory.

In my case I would create the structure of the gist that would mirror the root of a new project, but yes, now that you mention it, I can see someone just using the gist as a "basket for a bunch of files" and having the option to select where to put said files is a great idea.

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

No branches or pull requests

2 participants