diff --git a/fluxer_app/scripts/GenerateMessageLayoutCss.ts b/fluxer_app/scripts/GenerateMessageLayoutCss.ts index f6c38f290..63fccdbdb 100644 --- a/fluxer_app/scripts/GenerateMessageLayoutCss.ts +++ b/fluxer_app/scripts/GenerateMessageLayoutCss.ts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {existsSync, mkdirSync, readFileSync, writeFileSync} from 'node:fs'; +import {mkdirSync, writeFileSync} from 'node:fs'; import {dirname, join, relative} from 'node:path'; import {renderMessageLayoutCss} from '@app/features/theme/layout/MessageLayoutCss'; @@ -9,13 +9,6 @@ function main(): void { const appDir = join(scriptDir, '..'); const cssPath = join(appDir, 'src', 'features', 'theme', 'styles', 'generated', 'message-layout.css'); const css = renderMessageLayoutCss(); - if (process.argv.includes('--check')) { - if (!existsSync(cssPath) || readFileSync(cssPath, 'utf8') !== css) { - throw new Error(`${relative(appDir, cssPath)} is stale. Run pnpm generate:message-layout.`); - } - console.log(`Checked ${relative(appDir, cssPath)}`); - return; - } mkdirSync(dirname(cssPath), {recursive: true}); writeFileSync(cssPath, css); console.log(`Wrote ${relative(appDir, cssPath)}`); diff --git a/fluxer_app/scripts/add-data-flx-attributes.mjs b/fluxer_app/scripts/add-data-flx-attributes.mjs index bcf5764b0..ee912f335 100644 --- a/fluxer_app/scripts/add-data-flx-attributes.mjs +++ b/fluxer_app/scripts/add-data-flx-attributes.mjs @@ -650,7 +650,12 @@ function main() { changedFiles.push({file, added: result.added}); } } - const mode = options.write ? 'write' : options.check ? 'check' : 'dry-run'; + let mode = 'dry-run'; + if (options.write) { + mode = 'write'; + } else if (options.check) { + mode = 'check'; + } console.log( `data-flx ${mode}: filesScanned=${totals.filesScanned} filesChanged=${totals.filesChanged} added=${totals.added} existing=${totals.existing} skipped=${totals.skipped} target=${options.target}`, );