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

Trying to get a subdirectory in git mode with the js api #349

Open
jeffpreussner opened this issue Aug 17, 2022 · 1 comment
Open

Trying to get a subdirectory in git mode with the js api #349

jeffpreussner opened this issue Aug 17, 2022 · 1 comment

Comments

@jeffpreussner
Copy link

jeffpreussner commented Aug 17, 2022

Working on a node application that pulls files from a specific directory of a monorepo. The repo is currently public but eventually would be switched to a private repo so i am planning to use git mode to allow for this. Passing the sub directory as detailed in the documentation "user/repo/subdir" doesn't work when using the emitter function with git mode enabled (tar and cli work fine). The sub directory is getting ignored and the function is cloning the entire repository. Is this a limitation of git mode?

my code:

const emitter = degit(< myuser/repo/subdir >', {
              cache: false,
              force: true,
              mode:"git",
              verbose: true
});

emitter.on('info', info => logStatus("Info", JSON.stringify(info)));
{"code":"DEST_IS_EMPTY","message":"destination directory is empty"}`
{"code":"SUCCESS",
"message":"cloned dest/path",
"repo":{
...,
...,
...,
...,
...,
...,
"subdir":"/packages/create-react-app-js",
"mode":"tar" <- mode is tar anyways?
},
"dest":"dest/path"}
@nake89
Copy link

nake89 commented Sep 3, 2022

This issue has been fixed in community fork: https://github.com/tiged/tiged

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

2 participants