Skip to content

Commit c08094f

Browse files
committed
fix(generi): load config with correct remote origin
1 parent 21df5d7 commit c08094f

File tree

4 files changed

+21
-6
lines changed

4 files changed

+21
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ Push commits in actually branch after log
137137

138138
Publish(NPM) package in final log
139139

140-
##### `repository` Default: `undefined`
140+
##### `repository` Default: `force`
141141

142-
A URL to git repository for sha256 open link
142+
A URL to git repository for sha256 open link. 'ignore' option skip all repository loads and 'force' option get remote origin. repository https: charges normally.
143143

144144
##### `exclude` Default: `[" typo"]`
145145

src/changelog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const setBasic = (commit: Commit, config: GeneriOptions) => {
4949
}
5050

5151
const sha =
52-
config?.repository && config?.repository !== 'https:'
52+
config?.repository && config?.repository !== 'ignore'
5353
? ` - [[${commit.sha}](${config.repository}/commit/${commit.sha})]`
5454
: '';
5555

src/defines/generi-default.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"repository": "https:",
2+
"repository": "force",
33
"silent": false,
44
"commits": "none",
55
"tag": true,

src/generi.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,26 @@ export const getGeneri = async () => {
1111
defaultConfig,
1212
});
1313

14+
const csl = _console(config);
15+
1416
try {
15-
if (!config.repository) config.repository = getRemoteOrigin() || 'https:';
17+
if (
18+
config.repository &&
19+
(config.repository === 'force' || config.repository !== 'ignore')
20+
) {
21+
const remote = getRemoteOrigin();
22+
23+
config.repository = remote || 'ignore';
24+
25+
if (!remote) {
26+
csl.warning(
27+
`config.repository force source could not be found. 'repository' will be ignored.`
28+
);
29+
}
30+
}
1631
} catch (e) {
1732
// TODO: target others repo url
1833
}
1934

20-
return { config, console: _console(config) };
35+
return { config, console: csl };
2136
};

0 commit comments

Comments
 (0)