Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

Chore: Updated prerequisite to check Win Store version #96

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions src/main/handlers/Utilities/Prerequisites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { AppModel, getAppModel } from '../../../models/AppStatus'
export const WindowsPrerequisites: AppModel[] = [
getAppModel('wsl', 'Windows Subsystem for Linux (WSL)', 'wsl --status;', false),
getAppModel('wslUbuntu', 'WSL Ubuntu Distribution', 'wsl --status;', false),
getAppModel('wslUbuntuStore', 'Ubuntu from Windows Store', 'Get-service wslservice;', false),
getAppModel('dockerDesktop', 'Docker Desktop', 'docker version;', false),
getAppModel('dockerDesktopUbuntu', 'Docker Desktop WSL Ubuntu Integration', 'wsl docker version;', false)
]
5 changes: 3 additions & 2 deletions src/main/handlers/Utilities/Utilities.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Utilities {
return WindowsPrerequisites
}
} catch (err) {
log.error('Failed to get pre requisites.', err)
log.error('Failed to get prerequisites.', err)
}

return []
Expand All @@ -120,7 +120,7 @@ class Utilities {

if (error || stderr) {
log.error(
`Error while executing check ${prerequisite.name} command: ${prerequisite.checkCommand}.`,
`Error while executing the check ${prerequisite.name} command: ${prerequisite.checkCommand}.`,
error,
stderr
)
Expand All @@ -129,6 +129,7 @@ class Utilities {
if (
(prerequisite.id === 'wsl' && stdOutput) ||
(prerequisite.id === 'wslUbuntu' && stdOutput.includes(': Ubuntu')) ||
(prerequisite.id === 'wslUbuntuStore' && stdOutput) ||
((prerequisite.id === 'dockerDesktop' || prerequisite.id === 'dockerDesktopUbuntu') &&
stdOutput.includes('Server: Docker Desktop'))
) {
Expand Down
11 changes: 10 additions & 1 deletion src/renderer/components/Config/PrereqsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const PrereqsView = ({ sx }: Props) => {
}

const processDescriptions = (status: AppModel) => {
if (status.id === 'wsl' || status.id === 'wslUbuntu') {
if (status.id === 'wsl' || status.id === 'wslUbuntu' || status.id === 'wslUbuntuStore') {
status.description = (
<Typography fontSize={14}>
<span style={{ fontSize: 14, opacity: 0.6 }}>
Expand Down Expand Up @@ -83,6 +83,15 @@ const PrereqsView = ({ sx }: Props) => {
<br />
<code>wsl -s Ubuntu</code>
</>
)}{' '}
{status.id === 'wslUbuntuStore' && (
<>
<br />
<br />
<span style={{ fontSize: 14, opacity: 0.6 }}>
To install the Ubuntu distribution from the Windows Store, you can refer to docs above
</span>
</>
)}
</Typography>
)
Expand Down