Skip to content

Commit 1727b80

Browse files
committed
Remove unused Windows frontend
1 parent 849ddd0 commit 1727b80

File tree

10 files changed

+15
-215
lines changed

10 files changed

+15
-215
lines changed

lib/commands/install.js

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

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

55
module.exports = /** @type {import('yargs').CommandModule} */ ({
66
command: 'install',
@@ -12,10 +12,6 @@ module.exports = /** @type {import('yargs').CommandModule} */ ({
1212
});
1313
},
1414
async handler({ unattended }) {
15-
const installDelegate = loadOsModule('install', {
16-
darwin: () => require('../install/macos'),
17-
win32: () => require('../install/win32'),
18-
});
19-
await installDelegate.install({ unattended });
15+
await install.install({ unattended });
2016
},
2117
});

lib/commands/serve.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const fs = require('fs/promises');
55
const createCommandServer = require('../create-command-server');
66
const createVoiceServer = require('../create-voice-server');
77

8-
const WINDOWS_NAMED_PIPE = '\\\\?\\pipe\\my_pipe';
98
const MACOS_SYSTEM_DIR = '/tmp/at_driver_generic';
109
const MACOS_SOCKET_UNIX_PATH = '/tmp/at_driver_generic/driver.socket';
1110
const DEFAULT_PORT = 4382;
@@ -17,18 +16,13 @@ const DEFAULT_PORT = 4382;
1716
const log = (...args) => console.error(new Date().toISOString(), ...args);
1817

1918
const prepareSocketPath = async () => {
20-
if (process.platform === 'win32') {
21-
return WINDOWS_NAMED_PIPE;
22-
} else if (process.platform === 'darwin') {
23-
await fs.mkdir(MACOS_SYSTEM_DIR, { recursive: true });
24-
await fs.unlink(MACOS_SOCKET_UNIX_PATH).catch(error => {
25-
if (!error || error.code !== 'ENOENT') {
26-
throw error;
27-
}
28-
});
29-
return MACOS_SOCKET_UNIX_PATH;
30-
}
31-
throw new Error(`unsupported host platform '${process.platform}'`);
19+
await fs.mkdir(MACOS_SYSTEM_DIR, { recursive: true });
20+
await fs.unlink(MACOS_SOCKET_UNIX_PATH).catch(error => {
21+
if (!error || error.code !== 'ENOENT') {
22+
throw error;
23+
}
24+
});
25+
return MACOS_SOCKET_UNIX_PATH;
3226
};
3327

3428
module.exports = /** @type {import('yargs').CommandModule} */ ({

lib/commands/uninstall.js

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

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

55
module.exports = /** @type {import('yargs').CommandModule} */ ({
66
command: 'uninstall',
77
describe: 'Uninstall text to speech extension and other support',
88
async handler() {
9-
const installDelegate = loadOsModule('install', {
10-
darwin: () => require('../install/macos'),
11-
win32: () => require('../install/win32'),
12-
});
13-
await installDelegate.uninstall();
9+
await install.uninstall();
1410

1511
console.log('Uninstallation completed successfully.');
1612
},

lib/helpers/load-os-module.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

lib/install/win32.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

lib/modules/interaction.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
'use strict';
44

5-
const { loadOsModule } = require('../helpers/load-os-module');
5+
const interaction = require('./macos/interaction');
66

7-
module.exports = /** @type {ATDriverModules.Interaction} */ (
8-
loadOsModule('interaction', {
9-
win32: () => require('./win32/interaction'),
10-
darwin: () => require('./macos/interaction'),
11-
})
12-
);
7+
module.exports = interaction;

lib/modules/session.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
'use strict';
44

5-
const { loadOsModule } = require('../helpers/load-os-module');
5+
const session = require('./macos/session');
66

7-
module.exports = /** @type {ATDriverModules.Session} */ (
8-
loadOsModule('session', {
9-
win32: () => require('./win32/session'),
10-
darwin: () => require('./macos/session'),
11-
})
12-
);
7+
module.exports = session;

lib/modules/win32/interaction.js

Lines changed: 0 additions & 100 deletions
This file was deleted.

lib/modules/win32/session.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)