[ci] format

This commit is contained in:
natemoo-re 2023-05-31 16:49:24 +00:00 committed by fredkbot
parent bc5d6ed39f
commit 4e653a4d29
3 changed files with 8 additions and 13 deletions

View file

@ -289,12 +289,11 @@ async function runPostBuildHooks(
const config = container.options.settings.config; const config = container.options.settings.config;
const buildConfig = container.options.settings.config.build; const buildConfig = container.options.settings.config.build;
for (const [fileName, mutation] of mutations) { for (const [fileName, mutation] of mutations) {
const root = const root = isServerLikeOutput(config)
isServerLikeOutput(config) ? mutation.build === 'server'
? mutation.build === 'server' ? buildConfig.server
? buildConfig.server : buildConfig.client
: buildConfig.client : config.outDir;
: config.outDir;
const fileURL = new URL(fileName, root); const fileURL = new URL(fileName, root);
await fs.promises.mkdir(new URL('./', fileURL), { recursive: true }); await fs.promises.mkdir(new URL('./', fileURL), { recursive: true });
await fs.promises.writeFile(fileURL, mutation.code, 'utf-8'); await fs.promises.writeFile(fileURL, mutation.code, 'utf-8');

View file

@ -139,9 +139,7 @@ export function isEndpoint(file: URL, settings: AstroSettings): boolean {
} }
export function isModeServerWithNoAdapter(settings: AstroSettings): boolean { export function isModeServerWithNoAdapter(settings: AstroSettings): boolean {
return ( return isServerLikeOutput(settings.config) && !settings.adapter;
isServerLikeOutput(settings.config) && !settings.adapter
);
} }
export function relativeToSrcDir(config: AstroConfig, idOrUrl: URL | string) { export function relativeToSrcDir(config: AstroConfig, idOrUrl: URL | string) {

View file

@ -339,8 +339,7 @@ export async function runHookBuildGenerated({
buildConfig: BuildConfig; buildConfig: BuildConfig;
logging: LogOptions; logging: LogOptions;
}) { }) {
const dir = const dir = isServerLikeOutput(config) ? buildConfig.client : config.outDir;
isServerLikeOutput(config) ? buildConfig.client : config.outDir;
for (const integration of config.integrations) { for (const integration of config.integrations) {
if (integration?.hooks?.['astro:build:generated']) { if (integration?.hooks?.['astro:build:generated']) {
@ -366,8 +365,7 @@ export async function runHookBuildDone({
routes: RouteData[]; routes: RouteData[];
logging: LogOptions; logging: LogOptions;
}) { }) {
const dir = const dir = isServerLikeOutput(config) ? buildConfig.client : config.outDir;
isServerLikeOutput(config) ? buildConfig.client : config.outDir;
await fs.promises.mkdir(dir, { recursive: true }); await fs.promises.mkdir(dir, { recursive: true });
for (const integration of config.integrations) { for (const integration of config.integrations) {