Skip to content

Commit

Permalink
chore: use specific version for demo-java-x repo parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
clementdessoude committed Nov 12, 2023
1 parent f489ce2 commit c1a9304
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions packages/java-parser/scripts/clone-samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,30 @@ const sampleRepos = [
},
{
repoUrl: "https://github.com/nipafx/demo-java-x",
branch: "main"
branch: "main",
commitHash: "b9facd7bae57512793af4e197446d8064318bf04"
}
];

fs.emptyDirSync(samplesDir);

sampleRepos.forEach(cloneRepo);

function cloneRepo({ repoUrl, branch }) {
function cloneRepo({ repoUrl, branch, commitHash }) {
console.log(`cloning ${repoUrl}`);
cp.execSync(`git clone ${repoUrl} --branch ${branch} --depth 1`, {
cwd: samplesDir,
stdio: [0, 1, 2]
});
if (commitHash) {
cp.execSync(`git clone ${repoUrl} --branch ${branch}`, {
cwd: samplesDir,
stdio: [0, 1, 2]
});
cp.execSync(`git checkout ${commitHash}`, {
cwd: path.resolve(samplesDir, repoUrl.split("/").pop()),
stdio: [0, 1, 2]
});
} else {
cp.execSync(`git clone ${repoUrl} --branch ${branch} --depth 1`, {
cwd: samplesDir,
stdio: [0, 1, 2]
});
}
}

0 comments on commit c1a9304

Please sign in to comment.