Skip to content

Commit

Permalink
fetch seed_type will use localFetch (i.e. filesystem load) if it's a …
Browse files Browse the repository at this point in the history
…local location.

Part of #45.
  • Loading branch information
jkomoros committed Jul 22, 2023
1 parent 226df32 commit ed4d9b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/grow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,12 @@ const growFetch = async (seed : Seed<SeedDataFetch>, env : Environment) : Promis
return mockedResult(JSON.stringify(data, null, '\t'));
}

//If it's a local fetch then use the localFetch machinery.
//TODO: this logic will be wrong in cases where it's hosted on a domain
if (isLocalLocation(resource)) {
return seed.garden.profile.localFetch(resource);
}

const result = await fetch(resource, {
method,
body
Expand Down

0 comments on commit ed4d9b2

Please sign in to comment.