mirror of
https://github.com/facebook/react.git
synced 2026-02-25 13:13:03 +00:00
Sorry about the thrash in advance! This removes the top level `forget` directory which adds unnecessary nesting to our repo Hopefully everything still works
40 lines
960 B
JavaScript
40 lines
960 B
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
const execFileSync = require("child_process").execFileSync;
|
|
|
|
const exec = (command, args) => {
|
|
console.log("> " + [command].concat(args).join(" "));
|
|
const options = {
|
|
cwd: process.cwd(),
|
|
env: process.env,
|
|
stdio: "pipe",
|
|
encoding: "utf-8",
|
|
};
|
|
return execFileSync(command, args, options);
|
|
};
|
|
|
|
const execGitCmd = (args) => exec("git", args).trim().toString().split("\n");
|
|
|
|
const listChangedFiles = () => {
|
|
const mergeBase = execGitCmd(["merge-base", "HEAD", "main"]);
|
|
return new Set([
|
|
...execGitCmd([
|
|
"diff",
|
|
"--name-only",
|
|
"--relative",
|
|
"--diff-filter=ACMRTUB",
|
|
mergeBase,
|
|
]),
|
|
...execGitCmd(["ls-files", "--others", "--exclude-standard"]),
|
|
]);
|
|
};
|
|
|
|
module.exports = listChangedFiles;
|