diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/copyMimeTypes.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/scripts/copyMimeTypes.ts b/scripts/copyMimeTypes.ts index 9691070c..f56acff9 100644 --- a/scripts/copyMimeTypes.ts +++ b/scripts/copyMimeTypes.ts @@ -6,7 +6,7 @@ import options from '../.prettierrc.cjs'; const rootPath = path.resolve(__dirname, '..'); const mimeDbPath = path.resolve(rootPath, 'node_modules/mime-db/db.json'); -const mimeDbLicencePath = path.resolve( +const mimeDbLicensePath = path.resolve( rootPath, 'node_modules/mime-db/LICENSE' ); @@ -20,10 +20,8 @@ fs.readFile(mimeDbPath, 'utf8', (err, data) => { throw err; } - const licence = fs.readFileSync(mimeDbLicencePath, { encoding: 'utf8' }); - const mimeTypeFileContent = `// This file is generated by scripts/copyMimeTypes.ts\n// Do not edit this file directly. Instead, update mime-db and run \`pnpm run copy:mime-types\`\n\n/*\n${ - licence as string - }*/\n\nexport default ${data as string};\n`; + const license = fs.readFileSync(mimeDbLicensePath, { encoding: 'utf8' }); + const mimeTypeFileContent = `// This file is generated by scripts/copyMimeTypes.ts\n// Do not edit this file directly. Instead, update mime-db and run \`pnpm run copy:mime-types\`\n\n/*\n${license}*/\n\nexport default ${data};\n`; fs.writeFile( mimeTypesTsPath, @@ -33,7 +31,7 @@ fs.readFile(mimeDbPath, 'utf8', (err, data) => { throw err; } - console.log(`Mime types copied to ${mimeTypesTsPath as string}`); + console.log(`Mime types copied to ${mimeTypesTsPath}`); } ); }); |
