[ci] format
This commit is contained in:
parent
bc5d6ed39f
commit
4e653a4d29
3 changed files with 8 additions and 13 deletions
|
@ -289,12 +289,11 @@ async function runPostBuildHooks(
|
|||
const config = container.options.settings.config;
|
||||
const buildConfig = container.options.settings.config.build;
|
||||
for (const [fileName, mutation] of mutations) {
|
||||
const root =
|
||||
isServerLikeOutput(config)
|
||||
? mutation.build === 'server'
|
||||
? buildConfig.server
|
||||
: buildConfig.client
|
||||
: config.outDir;
|
||||
const root = isServerLikeOutput(config)
|
||||
? mutation.build === 'server'
|
||||
? buildConfig.server
|
||||
: buildConfig.client
|
||||
: config.outDir;
|
||||
const fileURL = new URL(fileName, root);
|
||||
await fs.promises.mkdir(new URL('./', fileURL), { recursive: true });
|
||||
await fs.promises.writeFile(fileURL, mutation.code, 'utf-8');
|
||||
|
|
|
@ -139,9 +139,7 @@ export function isEndpoint(file: URL, settings: AstroSettings): boolean {
|
|||
}
|
||||
|
||||
export function isModeServerWithNoAdapter(settings: AstroSettings): boolean {
|
||||
return (
|
||||
isServerLikeOutput(settings.config) && !settings.adapter
|
||||
);
|
||||
return isServerLikeOutput(settings.config) && !settings.adapter;
|
||||
}
|
||||
|
||||
export function relativeToSrcDir(config: AstroConfig, idOrUrl: URL | string) {
|
||||
|
|
|
@ -339,8 +339,7 @@ export async function runHookBuildGenerated({
|
|||
buildConfig: BuildConfig;
|
||||
logging: LogOptions;
|
||||
}) {
|
||||
const dir =
|
||||
isServerLikeOutput(config) ? buildConfig.client : config.outDir;
|
||||
const dir = isServerLikeOutput(config) ? buildConfig.client : config.outDir;
|
||||
|
||||
for (const integration of config.integrations) {
|
||||
if (integration?.hooks?.['astro:build:generated']) {
|
||||
|
@ -366,8 +365,7 @@ export async function runHookBuildDone({
|
|||
routes: RouteData[];
|
||||
logging: LogOptions;
|
||||
}) {
|
||||
const dir =
|
||||
isServerLikeOutput(config) ? buildConfig.client : config.outDir;
|
||||
const dir = isServerLikeOutput(config) ? buildConfig.client : config.outDir;
|
||||
await fs.promises.mkdir(dir, { recursive: true });
|
||||
|
||||
for (const integration of config.integrations) {
|
||||
|
|
Loading…
Reference in a new issue