1// SPDX-FileCopyrightText: 2025 The Project Pterodactyl Developers 2// 3// SPDX-License-Identifier: MPL-2.0 4 5import Foundation 6import llbuild2fx 7 8extension Keys.Blob { 9 struct ReadContents: BuildKey { 10 let blobId: LLBDataID 11 12 typealias ValueType = String 13 14 static let versionDependencies: [any FXVersioning.Type] = [] 15 16 func computeValue(_ ctx: BuildContext<Self>) async throws -> String { 17 let contents = try await ctx.load(blobId) 18 return try await String(decoding: Data(ctx.read(blob: contents.blob!)), as: UTF8.self) 19 } 20 } 21}