mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 01:25:36 -05:00
Feature/project build (#10332)
* initial build command execution * adding tests * Clean up test names * update SqltoolsService release in ADS for Build * Updating as per PR comments * updating yarn lock * Adding one more test for command run * Test fixes
This commit is contained in:
@@ -52,7 +52,7 @@ export const projectNameRequired = localize('projectNameRequired', "Name is requ
|
||||
export const projectLocationRequired = localize('projectLocationRequired', "Location is required to create a new database project.");
|
||||
export function projectAlreadyOpened(path: string) { return localize('projectAlreadyOpened', "Project '{0}' is already opened.", path); }
|
||||
export function projectAlreadyExists(name: string, path: string) { return localize('projectAlreadyExists', "A project named {0} already exists in {1}.", name, path); }
|
||||
|
||||
export function mssqlNotFound(mssqlConfigDir: string) { return localize('mssqlNotFound', "Could not get mssql extension's install location at {0}", mssqlConfigDir); }
|
||||
|
||||
// Project script types
|
||||
|
||||
|
||||
@@ -4,11 +4,14 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as os from 'os';
|
||||
/**
|
||||
* Consolidates on the error message string
|
||||
*/
|
||||
export function getErrorMessage(error: Error | string): string {
|
||||
return (error instanceof Error) ? error.message : error;
|
||||
export function getErrorMessage(error: any): string {
|
||||
return (error instanceof Error)
|
||||
? (typeof error.message === 'string' ? error.message : '')
|
||||
: typeof error === 'string' ? error : `${JSON.stringify(error, undefined, '\t')}`;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,3 +48,29 @@ export function trimChars(input: string, chars: string): string {
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/**
|
||||
* get quoted path to be used in any commandline argument
|
||||
* @param filePath
|
||||
*/
|
||||
export function getSafePath(filePath: string): string {
|
||||
return (os.platform() === 'win32') ?
|
||||
getSafeWindowsPath(filePath) :
|
||||
getSafeNonWindowsPath(filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* ensure that path with spaces are handles correctly
|
||||
*/
|
||||
export function getSafeWindowsPath(filePath: string): string {
|
||||
filePath = filePath.split('\\').join('\\\\').split('"').join('');
|
||||
return '"' + filePath + '"';
|
||||
}
|
||||
|
||||
/**
|
||||
* ensure that path with spaces are handles correctly
|
||||
*/
|
||||
export function getSafeNonWindowsPath(filePath: string): string {
|
||||
filePath = filePath.split('\\').join('/').split('"').join('');
|
||||
return '"' + filePath + '"';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user