mirror of
https://github.com/fluxerapp/fluxer.git
synced 2026-12-04 16:13:04 -08:00
chore(app): drop unused layout --check, flatten data-flx script
This commit is contained in:
2 files changed
+7
-9
No files matched your search
@@ -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)}`);
|
||||
|
||||
@@ -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}`,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user