File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
3- const { install } = require ( '../install/macos ' ) ;
3+ const { loadOsModule } = require ( '../helpers/load-os-module ' ) ;
44
55module . exports = /** @type {import('yargs').CommandModule } */ ( {
66 command : 'install' ,
@@ -12,8 +12,10 @@ module.exports = /** @type {import('yargs').CommandModule} */ ({
1212 } ) ;
1313 } ,
1414 async handler ( { unattended } ) {
15- const installed = await install ( { unattended } ) ;
16- const result = installed ? 'Installation completed successfully.' : 'Already installed' ;
17- console . log ( result ) ;
15+ const installDelegate = loadOsModule ( 'install' , {
16+ darwin : ( ) => require ( '../install/macos' ) ,
17+ win32 : ( ) => require ( '../install/win32' ) ,
18+ } ) ;
19+ await installDelegate . install ( { unattended } ) ;
1820 } ,
1921} ) ;
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ const promptForManualKeyPress = async () => {
8383 * @param {boolean } options.unattended - Whether installation should fail if
8484 * human intervention is required
8585 *
86- * @returns {Promise<boolean > }
86+ * @returns {Promise<void > }
8787 */
8888exports . install = async function ( { unattended } ) {
8989 const options = await getExecOptions ( ) ;
@@ -103,14 +103,14 @@ exports.install = async function ({ unattended }) {
103103 }
104104
105105 if ( await isInstalled ( ) ) {
106- return false ;
106+ console . log ( 'Already installed.' ) ;
107107 }
108108
109109 await removeQuarantine ( options ) ;
110110 await registerExtensions ( options ) ;
111111 await enableExtension ( ) ;
112112 await setSystemVoice ( VOICE_IDENTIFIER ) ;
113- return true ;
113+ console . log ( 'Installation completed successfully.' ) ;
114114} ;
115115
116116/**
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ const MAKE_VOICE_EXE = 'MakeVoice.exe';
1010
1111exports . install = async function ( ) {
1212 await exec ( `${ MAKE_VOICE_EXE } ` , await getExecOptions ( ) ) ;
13+ console . log ( 'Installation completed successfully.' ) ;
1314} ;
1415
1516exports . uninstall = async function ( ) {
You can’t perform that action at this time.
0 commit comments