Skip to content

Commit

Permalink
chore(notify): debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Airkro committed Dec 21, 2023
1 parent 99fdc62 commit 1a46b6b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 20 additions & 3 deletions packages/notify/lib/utils.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { execSync } from 'node:child_process';
import { createRequire } from 'node:module';

import { sync } from 'conventional-commits-parser';
Expand Down Expand Up @@ -116,6 +117,8 @@ const configs = {
};

function getlog(since, until) {
execSync(`git log --pretty=oneline ${since}...${until}`);

return gitlog({
repo: '.',
since,
Expand All @@ -127,14 +130,28 @@ function getlog(since, until) {
function getLogs() {
try {
return getlog(GIT_PREVIOUS_COMMIT, GIT_COMMIT);
} catch {
return getlog('HEAD~5', 'HEAD');
} catch (error) {
console.error(error);

try {
return getlog('HEAD~5', 'HEAD');
} catch (error_) {
console.error(error_);

try {
return getlog('HEAD~1', 'HEAD');
} catch (error__) {
console.error(error__);

return [];
}
}
}
}

function getCommits() {
const io =
GIT_COMMIT === GIT_PREVIOUS_COMMIT
GIT_COMMIT && GIT_COMMIT === GIT_PREVIOUS_COMMIT
? []
: sortBy(
Object.entries(
Expand Down
2 changes: 1 addition & 1 deletion packages/notify/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bring-it/notify",
"version": "0.2.3",
"version": "0.2.5",
"description": "Send releases notifications",
"license": "MIT",
"author": {
Expand Down

0 comments on commit 1a46b6b

Please sign in to comment.