Refactor install.ts

This commit is contained in:
Shivam Mathur
2020-10-04 17:03:02 +05:30
parent 8cb01730c7
commit f8e867a9ff
5 changed files with 77 additions and 52 deletions

View File

@ -377,6 +377,27 @@ export async function scriptExtension(os_version: string): Promise<string> {
}
}
/**
* Function to get script tool
*
* @param os_version
*/
export async function scriptTool(os_version: string): Promise<string> {
switch (os_version) {
case 'win32':
return 'pwsh';
case 'linux':
case 'darwin':
return 'bash';
default:
return await log(
'Platform ' + os_version + ' is not supported',
os_version,
'error'
);
}
}
/**
* Function to get script to add tools with custom support.
*