Skip to content
This repository was archived by the owner on Sep 7, 2025. It is now read-only.

Commit 2121023

Browse files
committed
adding git pull support
1 parent dc85679 commit 2121023

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

repos.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,7 @@
2828
"apple-script",
2929
"kotlin",
3030
"rust",
31-
"racket"
31+
"racket",
32+
"typescript",
33+
"julia"
3234
]

scripts/git-pull.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Git add all the repositories.
3+
*
4+
* @author Carlos Abraham Hernandez (abranhe.com) <abraham@abranhe.com>
5+
*/
6+
'use strict';
7+
const exist = require('dtfe');
8+
const chalk = require('chalk');
9+
const shell = require('shelljs');
10+
const commandExists = require('command-exists');
11+
const repos = require('../repos.json');
12+
13+
commandExists('git')
14+
.then(() => {
15+
if (!exist('./projects')) {
16+
shell.mkdir('./projects');
17+
}
18+
19+
shell.cd('./projects');
20+
try {
21+
repos.forEach((repo) => {
22+
if (exist(repo)) {
23+
shell.cd(repo);
24+
shell.exec(`git pull origin master`);
25+
shell.cd('../');
26+
}
27+
});
28+
} catch (_) {
29+
console.log(chalk.red('Something went wrong.'));
30+
}
31+
})
32+
.catch((_) => {
33+
console.log(chalk.red(`'git' is required!`));
34+
});

0 commit comments

Comments
 (0)