Skip to content

Commit

Permalink
Normalise source input path
Browse files Browse the repository at this point in the history
  • Loading branch information
rphillips-cc committed Sep 3, 2024
1 parent 619611e commit fca4316
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { guessSsg, ssgs } from './ssgs/ssgs.js';
import { findBasePath } from './collections.js';
import { normalisePath } from './utility.js';

export { ssgs } from './ssgs/ssgs.js';

Expand Down Expand Up @@ -70,11 +71,13 @@ export async function generateConfiguration(filePaths, options) {
* @returns {Promise<import('./types').BuildCommands>}
*/
export async function generateBuildCommands(filePaths, options) {
let source = options?.config?.source ? normalisePath(options.config.source) : undefined;

const ssg = options?.buildConfig?.ssg
? ssgs[options.buildConfig.ssg]
: guessSsg(filterPaths(filePaths, options?.config?.source));
: guessSsg(filterPaths(filePaths, source));

const source = options?.config?.source ?? ssg.getSource(filePaths);
source = source ?? ssg.getSource(filePaths);
filePaths = filterPaths(filePaths, source);

const files = ssg.groupFiles(filePaths);
Expand Down

0 comments on commit fca4316

Please sign in to comment.