Skip to content

Commit

Permalink
fix gitoid parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Cole Kennedy authored and colek42 committed Apr 18, 2023
1 parent c1e2cca commit 8b50529
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,21 @@ async function run() {
}

function extractDesiredGitOID(output) {
console.log("Output:", output);

const lines = output.split("\n");
const desiredLinePrefix = "Stored in archivist as ";

for (const line of lines) {
console.log("Processing line:", line);
if (line.startsWith(desiredLinePrefix)) {
console.log("Found desired line:", line);
const match = line.match(/[0-9a-fA-F]{64}/);
if (match) {
console.log("Matched Git OID:", match[0]);
return match[0];
} else {
console.log("No Git OID match found in desired line");
}
}
}
Expand Down

0 comments on commit 8b50529

Please sign in to comment.