Skip to content

Commit

Permalink
Added debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
m-radmacher committed Oct 24, 2022
1 parent 29b5785 commit d2b3432
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const pdfkit_1 = __importDefault(__nccwpck_require__(6790));
const fs = __importStar(__nccwpck_require__(7147));
const i18n_1 = __nccwpck_require__(2293);
const mailing_1 = __nccwpck_require__(5280);
const path_1 = __importDefault(__nccwpck_require__(1017));
function run() {
return __awaiter(this, void 0, void 0, function* () {
const sendEmail = core.getBooleanInput('send_email');
Expand Down Expand Up @@ -158,6 +159,14 @@ function createPDF(commits, owner, repo, language, baseTag, headTag) {
return __awaiter(this, void 0, void 0, function* () {
const doc = new pdfkit_1.default();
doc.pipe(fs.createWriteStream('output.pdf'));
// list available fonts
core.debug(fs.readdirSync(path_1.default.join(__dirname), { withFileTypes: true }).join('; '));
if (fs.existsSync(path_1.default.join(__dirname, 'fonts'))) {
core.debug(fs.readdirSync(path_1.default.join(__dirname, 'fonts'), { withFileTypes: true }).join('; '));
}
else {
core.debug('fonts folder does not exist');
}
doc
.font('./fonts/Inter.ttf')
.fontSize(25)
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
getGermanSubheader,
} from './i18n';
import { createMailTransport, sendChangelogMail, verifyMailTransporter } from './mailing';
import path from 'path';

export type Commit = {
author: string | null;
Expand Down Expand Up @@ -88,6 +89,14 @@ async function createPDF(
const doc = new PDFDocument();
doc.pipe(fs.createWriteStream('output.pdf'));

// list available fonts
core.debug(fs.readdirSync(path.join(__dirname), { withFileTypes: true }).join('; '));
if (fs.existsSync(path.join(__dirname, 'fonts'))) {
core.debug(fs.readdirSync(path.join(__dirname, 'fonts'), { withFileTypes: true }).join('; '));
} else {
core.debug('fonts folder does not exist');
}

doc
.font('./fonts/Inter.ttf')
.fontSize(25)
Expand Down

0 comments on commit d2b3432

Please sign in to comment.