-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (30 loc) · 878 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const { execSync } = require("child_process");
const targets = require("./targets.json");
// const execHandler = (error, stdout, stderr) => {
// if (error) {
// console.error(`exec error: ${error}`);
// return;
// }
// console.log(stdout);
// console.error(stderr);
// };
targets.forEach(({ language, projects }) => {
projects.forEach((project) => {
const projectName = project.split("/")[1];
try {
// 프로젝트 다운로드
const cloneProject = execSync(
`
if [ -d "projects/${language}/${projectName}" ]; then
echo "${project}가 이미 존재합니다."
else
git clone https://github.com/${project} projects/${language}/${projectName}
fi
`
);
console.log(cloneProject.toString());
} catch (cloneProjectError) {
console.error(cloneProjectError);
}
});
});