Skip to content

Commit

Permalink
Meta propagator updated
Browse files Browse the repository at this point in the history
  • Loading branch information
darsan-in committed Jul 9, 2024
1 parent a3ae0df commit 9d2bcce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
17 changes: 3 additions & 14 deletions action/fetch-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
var fs_1 = require("fs");
var https_1 = require("https");
Expand Down Expand Up @@ -377,7 +368,7 @@ function countLOC(languagesMeta) {
}
function main() {
return __awaiter(this, void 0, void 0, function () {
var ungroupedMeta, err_2, mostUsedLanguages, groupedMeta, processedMeta, totalCommits, localMeta;
var ungroupedMeta, err_2, mostUsedLanguages, groupedMeta, processedMeta, localMeta;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
Expand All @@ -398,20 +389,18 @@ function main() {
mostUsedLanguages = getMostUsedLanguages(ungroupedMeta);
groupedMeta = makeRepoGroups(mostUsedLanguages, ungroupedMeta);
processedMeta = __assign({ All: ungroupedMeta }, groupedMeta);
return [4 /*yield*/, commitsCounter(__spreadArray([], ungroupedMeta, true).map(function (meta) { return meta.url; }))];
case 5:
totalCommits = _a.sent();
localMeta = {
projects: processedMeta,
totalProjects: ungroupedMeta.length,
totalCommits: totalCommits,
totalCommits: 0,
};
(0, fs_1.writeFileSync)((0, path_1.join)(process.cwd(), "ghmeta.json"), JSON.stringify(localMeta));
return [2 /*return*/];
}
});
});
}
/* @ts-ignore */
function commitsCounter(urls) {
return __awaiter(this, void 0, void 0, function () {
var overallCommits, _loop_1, _i, urls_1, url;
Expand Down
7 changes: 4 additions & 3 deletions action/fetch-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,14 @@ async function main(): Promise<void> {
const groupedMeta = makeRepoGroups(mostUsedLanguages, ungroupedMeta);

const processedMeta = { All: ungroupedMeta, ...groupedMeta };
const totalCommits = await commitsCounter(
/* const totalCommits = await commitsCounter(
[...ungroupedMeta].map((meta) => meta.url),
);
); */

const localMeta = {
projects: processedMeta,
totalProjects: ungroupedMeta.length,
totalCommits: totalCommits,
totalCommits: 0,
};

writeFileSync(
Expand All @@ -382,6 +382,7 @@ async function main(): Promise<void> {
);
}

/* @ts-ignore */
async function commitsCounter(urls: string[]): Promise<number> {
let overallCommits: number = 0;

Expand Down

0 comments on commit 9d2bcce

Please sign in to comment.