Skip to content

Commit 3a2d3f0

Browse files
committed
Log readme path
1 parent cddecd1 commit 3a2d3f0

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

dist/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16783,17 +16783,18 @@ async function main() {
1678316783
.filter((block) => block.value.id !== databaseId)
1678416784
.map((block) => block.value);
1678516785

16786-
const readmeLines = fs
16787-
.readFileSync(__webpack_require__.ab + "README.md", 'utf-8')
16788-
.split('\n');
16786+
const README_PATH = __webpack_require__.ab + "README.md";
16787+
core.info(`Reading from ${README_PATH}`);
16788+
16789+
const readmeLines = fs.readFileSync(__webpack_require__.ab + "README.md", 'utf-8').split('\n');
1678916790
// Find the index corresponding to <!--START_SECTION:notion_learn--> comment
1679016791
let startIdx = readmeLines.findIndex(
1679116792
(content) => content.trim() === '<!--START_SECTION:notion_learn-->'
1679216793
);
1679316794

1679416795
// Early return in case the <!--START_SECTION:notion_learn--> comment was not found
1679516796
if (startIdx === -1) {
16796-
return console.error(
16797+
return core.setFailed(
1679716798
`Couldn't find the <!--START_SECTION:notion_learn--> comment. Exiting!`
1679816799
);
1679916800
}
@@ -16813,10 +16814,9 @@ async function main() {
1681316814
...readmeLines.slice(endIdx)
1681416815
];
1681516816

16816-
fs.writeFileSync(
16817-
__webpack_require__.ab + "README.md",
16818-
finalLines.join('\n')
16819-
);
16817+
core.info(`Writing to ${README_PATH}`);
16818+
16819+
fs.writeFileSync(__webpack_require__.ab + "README.md", finalLines.join('\n'));
1682016820

1682116821
try {
1682216822
await commitFile();

src/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,18 @@ async function main() {
9999
.filter((block) => block.value.id !== databaseId)
100100
.map((block) => block.value);
101101

102-
const readmeLines = fs
103-
.readFileSync(path.resolve(__dirname, '../README.md'), 'utf-8')
104-
.split('\n');
102+
const README_PATH = path.resolve(__dirname, '../README.md');
103+
core.info(`Reading from ${README_PATH}`);
104+
105+
const readmeLines = fs.readFileSync(README_PATH, 'utf-8').split('\n');
105106
// Find the index corresponding to <!--START_SECTION:notion_learn--> comment
106107
let startIdx = readmeLines.findIndex(
107108
(content) => content.trim() === '<!--START_SECTION:notion_learn-->'
108109
);
109110

110111
// Early return in case the <!--START_SECTION:notion_learn--> comment was not found
111112
if (startIdx === -1) {
112-
return console.error(
113+
return core.setFailed(
113114
`Couldn't find the <!--START_SECTION:notion_learn--> comment. Exiting!`
114115
);
115116
}
@@ -129,10 +130,9 @@ async function main() {
129130
...readmeLines.slice(endIdx)
130131
];
131132

132-
fs.writeFileSync(
133-
path.resolve(__dirname, '../README.md'),
134-
finalLines.join('\n')
135-
);
133+
core.info(`Writing to ${README_PATH}`);
134+
135+
fs.writeFileSync(README_PATH, finalLines.join('\n'));
136136

137137
try {
138138
await commitFile();

0 commit comments

Comments
 (0)