diff --git a/lib/App.js b/lib/App.js index 7d90d25b..e6b2e4ed 100644 --- a/lib/App.js +++ b/lib/App.js @@ -1701,17 +1701,28 @@ $ sudo systemctl restart docker const templatePath = path.join(__dirname, '..', 'assets', 'templates', 'app', 'drivers'); - // TODO FIX FOR MERGE // Matter devices do not need a device/driver file. As apps cannot add functionality to Matter devices. if (!driverWireless.matter) { if (App.usesModules({ appPath: this.path })) { - await copyFileAsync(path.join(templatePath, 'driver.mjs'), path.join(driverPath, 'driver.js')); - await copyFileAsync(path.join(templatePath, 'device.mjs'), path.join(driverPath, 'device.js')); - } else { - const fileExtension = App.usesTypeScript({ appPath: this.path }) ? '.ts' : '.js'; - await copyFileAsync(path.join(templatePath, `driver${fileExtension}`), path.join(driverPath, `driver${fileExtension}`)); - await copyFileAsync(path.join(templatePath, `device${fileExtension}`), path.join(driverPath, `device${fileExtension}`)); - } + await copyFileAsync( + path.join(templatePath, 'driver.mjs'), + path.join(driverPath, 'driver.js'), + ); + await copyFileAsync( + path.join(templatePath, 'device.mjs'), + path.join(driverPath, 'device.js'), + ); + } else { + const fileExtension = App.usesTypeScript({ appPath: this.path }) ? '.ts' : '.js'; + await copyFileAsync( + path.join(templatePath, `driver${fileExtension}`), + path.join(driverPath, `driver${fileExtension}`), + ); + await copyFileAsync( + path.join(templatePath, `device${fileExtension}`), + path.join(driverPath, `device${fileExtension}`), + ); + } } await fse.ensureDir(path.join(driverPath, 'assets'));