Skip to content
Open
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
21 changes: 7 additions & 14 deletions src/serverSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,16 @@ export async function installCodeServer(conn: SSHConnection, serverDownloadUrlTe

// detect platform and shell for windows
if (!platform || platform === 'windows') {
const result = await conn.exec('uname -s');
const result = await conn.exec('dir ..');

if (result.stdout) {
if (result.stdout.includes('windows32')) {
platform = 'windows';
} else if (result.stdout.includes('MINGW64')) {
platform = 'windows';
shell = 'bash';
}
} else if (result.stderr) {
if (result.stderr.includes('FullyQualifiedErrorId : CommandNotFoundException')) {
platform = 'windows';
}

if (result.stderr.includes('is not recognized as an internal or external command')) {
platform = 'windows';
platform = 'windows';
if (result.stdout.includes('LastWriteTime')) {
shell = 'powershell';
} else if (result.stdout.includes('<DIR>')) {
shell = 'cmd';
} else {
shell = 'bash';
}
}

Expand Down