@@ -32,44 +32,44 @@ function findOrDownloadTool(config: VersionConfig): Promise<string> {
3232}
3333
3434export default async function install ( ) {
35- try {
36- const { version, password, collation, installArgs, wait, skipOsCheck } = gatherInputs ( ) ;
37- // we only support windows for now. But allow crazy people to skip this check if they like...
38- if ( ! skipOsCheck && os . platform ( ) !== 'win32' ) {
39- throw new Error ( `setup-sqlserver only supports Windows runners, got: ${ os . platform ( ) } ` ) ;
40- }
41- const osVersion = await getOsVersion ( ) ;
42- if ( ! VERSIONS . has ( version ) ) {
43- throw new Error ( `Unsupported SQL Version, supported versions are ${ Array . from ( VERSIONS . keys ( ) ) . join ( ', ' ) } , got: ${ version } ` ) ;
44- }
45- const config = VERSIONS . get ( version ) ! ;
46- // try to fail fast if the OS is not supported
47- if ( config . osSupport ) {
48- const { min, max } = config . osSupport ;
49- // allow checks to be skipped
50- if ( skipOsCheck ) {
51- core . info ( 'Skipping OS checks' ) ;
52- } else if ( ! osVersion ) {
53- core . notice ( 'Unable to determine OS version, continuing tentatively' ) ;
54- } else if ( ( min && min > osVersion ) || ( max && max < osVersion ) ) {
55- // construct a helpful error
56- let message = 'Please use ' ;
35+ const { version, password, collation, installArgs, wait, skipOsCheck } = gatherInputs ( ) ;
36+ // we only support windows for now. But allow crazy people to skip this check if they like...
37+ if ( ! skipOsCheck && os . platform ( ) !== 'win32' ) {
38+ throw new Error ( `setup-sqlserver only supports Windows runners, got: ${ os . platform ( ) } ` ) ;
39+ }
40+ const osVersion = await getOsVersion ( ) ;
41+ if ( ! VERSIONS . has ( version ) ) {
42+ throw new Error ( `Unsupported SQL Version, supported versions are ${ Array . from ( VERSIONS . keys ( ) ) . join ( ', ' ) } , got: ${ version } ` ) ;
43+ }
44+ const config = VERSIONS . get ( version ) ! ;
45+ // try to fail fast if the OS is not supported
46+ if ( config . osSupport ) {
47+ const { min, max } = config . osSupport ;
48+ // allow checks to be skipped
49+ if ( skipOsCheck ) {
50+ core . info ( 'Skipping OS checks' ) ;
51+ } else if ( ! osVersion ) {
52+ core . notice ( 'Unable to determine OS version, continuing tentatively' ) ;
53+ } else if ( ( min && min > osVersion ) || ( max && max < osVersion ) ) {
54+ // construct a helpful error
55+ let message = 'Please use ' ;
56+ if ( min ) {
57+ message += `windows-${ min } ` ;
58+ }
59+ if ( max ) {
5760 if ( min ) {
58- message += `windows-${ min } ` ;
59- }
60- if ( max ) {
61- if ( min ) {
62- message += ' to ' ;
63- }
64- message += `windows-${ max } ` ;
61+ message += ' to ' ;
6562 }
66- message += '.' ;
67- throw new Error ( `Runner version windows-${ osVersion } is not supported for SQL Server ${ version } . ${ message } ` ) ;
63+ message += `windows-${ max } ` ;
6864 }
65+ message += '.' ;
66+ throw new Error ( `Runner version windows-${ osVersion } is not supported for SQL Server ${ version } . ${ message } ` ) ;
6967 }
70- // Initial checks complete - fetch the installer
71- const toolPath = await core . group ( `Fetching install media for ${ version } ` , ( ) => findOrDownloadTool ( config ) ) ;
72- const instanceName = 'MSSQLSERVER' ;
68+ }
69+ // Initial checks complete - fetch the installer
70+ const toolPath = await core . group ( `Fetching install media for ${ version } ` , ( ) => findOrDownloadTool ( config ) ) ;
71+ const instanceName = 'MSSQLSERVER' ;
72+ try {
7373 // @todo - make sure that the arguments are unique / don't conflict
7474 await core . group ( 'Installing SQL Server' , ( ) => exec . exec ( `"${ toolPath } "` , [
7575 '/q' ,
0 commit comments