Skip to content

Commit e75f644

Browse files
committed
type-fixup! reverts win32 install removal
1 parent 92aa646 commit e75f644

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

shared/commands/install.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const { install } = require('../install/macos');
3+
const { loadOsModule } = require('../helpers/load-os-module');
44

55
module.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
});

shared/install/macos.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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
*/
8888
exports.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+
return 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
/**

shared/install/win32.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const MAKE_VOICE_EXE = 'MakeVoice.exe';
1010

1111
exports.install = async function () {
1212
await exec(`${MAKE_VOICE_EXE}`, await getExecOptions());
13+
console.log('Installation completed successfully.');
1314
};
1415

1516
exports.uninstall = async function () {

0 commit comments

Comments
 (0)