feat(firstOpenProject): be based on os and shell version to provide different commands that open project in remote env
This commit is contained in:
16
src/utils.ts
16
src/utils.ts
@@ -116,4 +116,20 @@ export async function showErrorNotification(message: string): Promise<void> {
|
||||
} else if (selection === 'Report a problem') {
|
||||
vscode.commands.executeCommand('vscode.open', vscode.Uri.parse('https://gitee.com/SuperIDE/DevStar/issues'));
|
||||
}
|
||||
}
|
||||
|
||||
export async function powershellVersion(): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
exec('powershell -Command "$PSVersionTable.PSVersion.ToString()"', (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
reject(`Error executing PowerShell command: ${error.message}`);
|
||||
return;
|
||||
}
|
||||
if (stderr) {
|
||||
reject(`PowerShell command returned an error: ${stderr}`);
|
||||
return;
|
||||
}
|
||||
resolve(stdout.trim());
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user