Skip to content

Commit

Permalink
fix: default to empty string if distro is null (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryhinchey authored Apr 6, 2021
1 parent 1dd1c15 commit 443ddb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = {
version = utils.run('sw_vers -productVersion ');
} else if (utils.isLinux) {
version = utils.run('cat /etc/os-release').then(v => {
const distro = (v || '').match(/NAME="(.+)"/);
const distro = (v || '').match(/NAME="(.+)"/) || '';
const versionInfo = (v || '').match(/VERSION="(.+)"/) || ['', ''];
const versionStr = versionInfo !== null ? versionInfo[1] : '';
return `${distro[1]} ${versionStr}`.trim() || '';
Expand Down

0 comments on commit 443ddb9

Please sign in to comment.