Skip to content

Commit 2ecf971

Browse files
committedJan 1, 2025
fix: fix github-corners option issue. #98
1 parent 3d30247 commit 2ecf971

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
 

Diff for: ‎packages/action/dist/action.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -167569,7 +167569,7 @@ function utils_formatConfig(opts) {
167569167569
var projectPkg = external_path_.resolve(process.cwd(), opts.config || 'package.json');
167570167570
var pgkData = {};
167571167571
if (fs_extra_lib.existsSync(projectPkg)) {
167572-
var _options$document$tit, _ref, _opts$githubCorners;
167572+
var _options$document$tit, _ref, _opts$githubCorners, _pgkData$repository;
167573167573
pgkData = fs_extra_lib.readJSONSync(projectPkg);
167574167574
if (pgkData['markdown-to-html']) {
167575167575
var mth = pgkData['markdown-to-html'];
@@ -167589,7 +167589,7 @@ function utils_formatConfig(opts) {
167589167589
options.document = _objectSpread2(_objectSpread2({}, options.document), pgkData.document);
167590167590
}
167591167591
options.document.title = (_options$document$tit = options.document.title) !== null && _options$document$tit !== void 0 ? _options$document$tit : pgkData.name;
167592-
options['github-corners'] = (_ref = (_opts$githubCorners = opts['github-corners']) !== null && _opts$githubCorners !== void 0 ? _opts$githubCorners : options['github-corners']) !== null && _ref !== void 0 ? _ref : typeof pgkData.repository === 'string' ? pgkData.repository : pgkData.repository.url;
167592+
options['github-corners'] = (_ref = (_opts$githubCorners = opts['github-corners']) !== null && _opts$githubCorners !== void 0 ? _opts$githubCorners : options['github-corners']) !== null && _ref !== void 0 ? _ref : typeof pgkData.repository === 'string' ? pgkData.repository : typeof pgkData.repository === 'object' && (_pgkData$repository = pgkData.repository) !== null && _pgkData$repository !== void 0 && _pgkData$repository.url ? pgkData.repository.url : undefined;
167593167593
}
167594167594
if (opts['github-corners'] && typeof opts['github-corners'] === 'string') {
167595167595
options['github-corners'] = opts['github-corners'].replace(/^git[+]/, '');

Diff for: ‎packages/cli/src/utils.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export function formatConfig(opts: Options) {
2222
options.document = { ...options.document, ...pgkData.document }
2323
}
2424
options.document.title = options.document.title ?? pgkData.name;
25-
options['github-corners'] = opts['github-corners'] ?? options['github-corners'] ?? (typeof pgkData.repository === 'string' ? pgkData.repository : pgkData.repository.url);
25+
options['github-corners'] = opts['github-corners'] ?? options['github-corners'] ?? (
26+
typeof pgkData.repository === 'string' ? pgkData.repository : (typeof pgkData.repository === 'object' && pgkData.repository?.url ? pgkData.repository.url : undefined)
27+
);
2628
}
2729
if (opts['github-corners'] && typeof opts['github-corners'] === 'string') {
2830
options['github-corners'] = opts['github-corners'].replace(/^git[+]/, '')

0 commit comments

Comments
 (0)
Please sign in to comment.