default Path writeUsing(Path path, Consumer<Writer> consumer) {
        Path resolved = addFile(path);

        try (Writer writer = Files.newBufferedWriter(resolved)) {
            consumer.accept(writer);
            writer.write('\n');
        } catch (IOException e) {
            throw new SmithyBuildException("Unable to create a write to file `" + resolved + "`: " + e.getMessage(), e);
        }

        return resolved;
    }
Adds a file to the result generated by passing a writer to the consumer.

@param path Relative path to write to.
@param consumer Node data to write to JSON.
@return Returns the resolved path.
smithy-build/src/main/java/software/amazon/smithy/build/FileManifest.java