support Solus Linux - fixes #4881

This commit is contained in:
Eugene Pankov
2022-01-31 22:03:12 +01:00
parent d6e69f5bf5
commit 767f9f3215

View File

@@ -18,7 +18,14 @@ export class POSIXShellsProvider extends ShellProvider {
if (this.hostApp.platform === Platform.Windows) { if (this.hostApp.platform === Platform.Windows) {
return [] return []
} }
return (await fs.readFile('/etc/shells', { encoding: 'utf-8' })) let shellListPath = '/etc/shells'
try {
await fs.stat(shellListPath)
} catch {
// Solus Linux
shellListPath = '/usr/share/defaults/etc/shells'
}
return (await fs.readFile(shellListPath, { encoding: 'utf-8' }))
.split('\n') .split('\n')
.map(x => x.trim()) .map(x => x.trim())
.filter(x => x && !x.startsWith('#')) .filter(x => x && !x.startsWith('#'))