react-native-test-app
Version:
react-native-test-app provides a test app for all supported platforms as a package
24 lines (20 loc) • 667 B
JavaScript
//
// Copyright (c) Microsoft Corporation
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
//
// @ts-check
const { spawnSync } = require("child_process");
const fs = require("fs");
const prettier = require("prettier");
const diff = process.argv.slice(2).reduce((diff, filepath) => {
const source = fs.readFileSync(filepath, { encoding: "utf8" });
const { stdout } = spawnSync("diff", ["--unified", filepath, "-"], {
input: prettier.format(source, { filepath }),
encoding: "utf-8",
});
return diff + stdout;
}, "");
require("suggestion-bot")(diff);