diff --git a/src/garden.ts b/src/garden.ts index 5737649..80c8957 100644 --- a/src/garden.ts +++ b/src/garden.ts @@ -151,7 +151,8 @@ export class Garden { if (verbose) { this.profile.log(`Fetching local seed packet: ${location}`); } - const data = await this.profile.localFetch(location); + const str = await this.profile.localFetch(location); + const data = JSON.parse(str); return seedPacket.parse(data); } diff --git a/src/profile.ts b/src/profile.ts index 05ae54d..ede87c9 100644 --- a/src/profile.ts +++ b/src/profile.ts @@ -99,7 +99,7 @@ export class Profile{ console.log(message, ...optionalParams); } - async localFetch(_location : string) : Promise { + async localFetch(_location : string) : Promise { throw new Error('localFetch is not supported on this profile type'); } diff --git a/tools/profile_filesystem.ts b/tools/profile_filesystem.ts index 05fbae0..de05a60 100644 --- a/tools/profile_filesystem.ts +++ b/tools/profile_filesystem.ts @@ -44,9 +44,8 @@ export class ProfileFilesystem extends Profile { this._storeFilesystems = {}; } - override async localFetch(location : string) : Promise { - const file = fs.readFileSync(location).toString(); - return JSON.parse(file); + override async localFetch(location : string) : Promise { + return fs.readFileSync(location).toString(); } override async prompt(question: string, defaultValue: LeafValue): Promise {