Skip to content

Commit

Permalink
Attempt to debug test
Browse files Browse the repository at this point in the history
  • Loading branch information
stwiname committed Dec 10, 2024
1 parent a12ce84 commit f43ee27
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/cli/src/controller/init-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,17 @@ export async function cloneProjectTemplate(
const tempPath = await makeTempDir();
//use sparse-checkout to clone project to temp directory
await git(tempPath).init().addRemote('origin', selectedProject.remote);
await git(tempPath).raw('sparse-checkout', 'set', `${selectedProject.path}`);
const res = await git(tempPath).raw('sparse-checkout', 'set', `${selectedProject.path}`);

console.log('Sparse checkout res', res);
await git(tempPath).raw('pull', 'origin', 'main');
// Copy content to project path
copySync(path.join(tempPath, `${selectedProject.path}`), projectPath);
try {
copySync(path.join(tempPath, selectedProject.path), projectPath);
} catch (e) {
console.log('TMP CONTENTS', fs.readdirSync(tempPath));
throw e;
}
// Clean temp folder
fs.rmSync(tempPath, {recursive: true, force: true});
return projectPath;
Expand Down

0 comments on commit f43ee27

Please sign in to comment.