Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ features/src/**/installer_*

# Cache for prepared and cleaned feature for packaging/publishing
.prepared-feature/

.devcontainer/devcontainer-lock.json
2 changes: 1 addition & 1 deletion features/src/system-packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Install arbitrary system packages using the system package manager.

```json
"features": {
"ghcr.io/postfinance/devcontainer-features/system-packages:1.0.0": {
"ghcr.io/postfinance/devcontainer-features/system-packages:1.0.1": {
"packages": ""
}
}
Expand Down
4 changes: 2 additions & 2 deletions features/src/system-packages/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "system-packages",
"version": "1.0.0",
"version": "1.0.1",
"name": "System Packages",
"description": "Install arbitrary system packages using the system package manager.",
"options": {
Expand All @@ -14,4 +14,4 @@
"default": ""
}
}
}
}
12 changes: 5 additions & 7 deletions installer/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,28 +107,26 @@ func (s *system) OsInfo() *OsInfo {
if err := scanner.Err(); err != nil {
return
}
// We do not know which values are provided by the OS, so we take what
// we can get and set undefined values to "unknown"
vendor, ok := infoMap["ID"]
if !ok {
return
vendor = "unknown"
}
codename, ok := infoMap["VERSION_CODENAME"]
if !ok {
return
codename = "unknown"
}
versionId, ok := infoMap["VERSION_ID"]
if !ok {
return
versionId = "unknown"
}
s.osInfo = &OsInfo{
Vendor: vendor,
Codename: codename,
VersionId: versionId,
}
})
if s.osInfo == nil {
// Fill with unknown if we couldn't read the OS info
s.osInfo = &OsInfo{Vendor: "unknown", Codename: "unknown", VersionId: "unknown"}
}
return s.osInfo
}

Expand Down
Loading