Skip to content

Commit 3a9e65b

Browse files
committed
perf: start call of generi config file
1 parent abcb316 commit 3a9e65b

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

src/generi.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@ import { getConfigRoot, setFile, getFile } from './utils';
33
import { success } from './console';
44
import { destr } from 'destr';
55

6-
export const isSilent = () => getGeneriConfig().silent;
7-
export const isTag = () => getGeneriConfig().tag;
8-
export const isVersion = () => getGeneriConfig().version;
9-
export const isConventionalCommits = () =>
10-
getGeneriConfig().commits === 'conventional-commits';
6+
export const getGeneri = (): GeneriOptions => {
7+
return destr<GeneriOptions>(getFile(getConfigRoot()));
8+
};
119

12-
export const setGeneriConfig = (config: GeneriOptions) => {
13-
setFile(getConfigRoot(), config);
10+
const config = getGeneri();
11+
export const getGeneriConfig = () => config;
1412

15-
success('Generate <generi.json>');
16-
};
13+
export const isSilent = () => config.silent;
14+
export const isTag = () => config.tag;
15+
export const isVersion = () => config.version;
16+
export const isConventionalCommits = () => config.commits === 'conventional-commits';
1717

18-
export const getGeneriConfig = (): GeneriOptions => {
19-
return destr<GeneriOptions>(getFile(getConfigRoot()));
18+
export const setGeneriConfig = (generi: GeneriOptions) => {
19+
setFile(getConfigRoot(), generi);
20+
21+
success('Generate <generi.json>');
2022
};

0 commit comments

Comments
 (0)