Skip to content

Commit

Permalink
backend: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
soumyaDghosh committed Dec 16, 2024
1 parent 1d97c12 commit d885245
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
3 changes: 1 addition & 2 deletions snap/gui/heroic.desktop
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[Desktop Entry]
#Name=Heroic Games Launcher
Name=Heroic Snap
Name=Heroic Games Launcher
Exec=heroic %u
Terminal=false
Type=Application
Expand Down
21 changes: 10 additions & 11 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ package-repositories:
suites: [jammy]
architectures: [amd64, i386]
key-id: 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280
url: https://deb.nodesource.com/node_20.x
url: https://deb.nodesource.com/node_20.x

layout:
/usr/share/zenity:
Expand Down Expand Up @@ -97,7 +97,7 @@ parts:
launcher:
after: [heroic]
plugin: nil
source: $CRAFT_PROJECT_DIR/snap/local/src
source: $CRAFT_PROJECT_DIR/snap/local/src
override-build: |
mkdir -p $CRAFT_PART_INSTALL/usr/bin
cp * $CRAFT_PART_INSTALL/usr/bin/
Expand Down Expand Up @@ -193,7 +193,7 @@ parts:
after: [heroic]
plugin: nil
source: https://github.com/ninja-build/ninja.git
source-tag: "v1.12.1"
source-tag: 'v1.12.1'
override-build: |
rm -rf build
rm -f ninja
Expand All @@ -215,7 +215,7 @@ parts:
after: [ninja]
plugin: nil
source: https://github.com/mesonbuild/meson.git
source-tag: "1.4.1"
source-tag: '1.4.1'
source-depth: 1
override-build: |
python3 -m pip install .
Expand All @@ -233,7 +233,7 @@ parts:
mangohud:
after: [meson-deps]
source: https://github.com/flightlessmango/MangoHud.git
source-tag: "v0.7.2"
source-tag: 'v0.7.2'
source-depth: 1
plugin: meson
organize:
Expand Down Expand Up @@ -262,13 +262,13 @@ parts:
- libxkbcommon-dev
# Fixes the $LIB being escaped for some reason
override-build: |
craftctl default
sed -i 's/\/usr\/\\\$LIB/\$SNAP\/usr\/lib\/x86_64-linux-gnu/' $CRAFT_PART_INSTALL/usr/bin/mangohud
craftctl default
sed -i 's/\/usr\/\\\$LIB/\$SNAP\/usr\/lib\/x86_64-linux-gnu/' $CRAFT_PART_INSTALL/usr/bin/mangohud
mangohud64:
after: [meson-deps, mangohud]
source: https://github.com/flightlessmango/MangoHud.git
source-tag: "v0.7.2"
source-tag: 'v0.7.2'
source-depth: 1
plugin: meson
organize:
Expand All @@ -283,12 +283,12 @@ parts:
- -usr/share/vulkan/implicit_layer.d/MangoHud.x86_64.json
- -usr/share/vulkan/implicit_layer.d/libMangoApp.json
- -usr/share/doc/mangohud/MangoHud.conf.example
- -usr/share/man/man1/mangohud.1
- -usr/share/man/man1/mangohud.1

gamemode:
after: [meson-deps]
source: https://github.com/FeralInteractive/gamemode.git
source-tag: "1.8.2"
source-tag: '1.8.2'
source-depth: 1
plugin: meson
organize:
Expand Down Expand Up @@ -420,7 +420,6 @@ parts:
- -usr/share/themes
- -usr/libexec


conditioning:
after: [heroic, debs]
plugin: nil
Expand Down
14 changes: 9 additions & 5 deletions src/backend/utils/systeminfo/osInfo/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ function stripQuotes(stringMaybeWithQuotes: string): string {

async function osInfo_linux(): Promise<{ name: string; version?: string }> {
let os_release_path: string | null = null
for (const potPath of ['/run/host/os-release', '/var/lib/snapd/hostfs/etc/os-release', '/etc/os-release']) {
for (const potPath of [
'/run/host/os-release',
'/var/lib/snapd/hostfs/etc/os-release',
'/etc/os-release'
]) {
try {
await stat(potPath)
os_release_path = potPath
Expand All @@ -41,13 +45,13 @@ async function osInfo_linux(): Promise<{ name: string; version?: string }> {
const osName = nameMatch
? stripQuotes(nameMatch)
: prettyNameMatch
? stripQuotes(prettyNameMatch)
: 'Linux'
? stripQuotes(prettyNameMatch)
: 'Linux'
const osVersion = versionMatch
? stripQuotes(versionMatch)
: versionId && versionCodename
? `${versionId} ${versionCodename}`
: undefined
? `${versionId} ${versionCodename}`
: undefined
if (osVersion) return { name: osName, version: osVersion }
return { name: osName }
}
Expand Down

0 comments on commit d885245

Please sign in to comment.