Skip to content

Commit ee1535a

Browse files
fix TS2322 and update @typescript-eslint/* (#479)
* feat: add branch 'master' * chore: remove lock file * fix(ts): error TS2322 Type 'string | void | Buffer' is not assignable to type 'string'. Type 'void' is not assignable to type 'string'. * chore(deps-dev): update typescript-eslint/* - @typescript-eslint/[email protected] - @typescript-eslint/[email protected] * chore: restore lock file from hexojs/hexo-cli * chore(deps): reinstall using `npm@8` --------- Co-authored-by: yoshinorin <[email protected]>
1 parent 40cdf2a commit ee1535a

File tree

4 files changed

+69
-412
lines changed

4 files changed

+69
-412
lines changed

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[submodule "assets"]
22
path = assets
33
url = https://github.com/hexojs/hexo-starter.git
4+
branch = master

lib/console/version.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ async function versionConsole() {
1313

1414
console.log('hexo-cli:', pkg.version);
1515

16-
let osInfo = '';
16+
let osInfo: string | void | Buffer;
1717
if (platform === 'darwin') osInfo = await spawn('sw_vers', '-productVersion');
1818
else if (platform === 'linux') {
1919
const v = await spawn('cat', '/etc/os-release');
20-
const distro = (v || '').match(/NAME="(.+)"/);
21-
const versionInfo = (v || '').match(/VERSION="(.+)"/) || ['', ''];
20+
const distro = String(v || '').match(/NAME="(.+)"/);
21+
const versionInfo = String(v || '').match(/VERSION="(.+)"/) || ['', ''];
2222
const versionStr = versionInfo !== null ? versionInfo[1] : '';
2323
osInfo = `${distro[1]} ${versionStr}`.trim() || '';
2424
}

0 commit comments

Comments
 (0)