(cwd)
| 58 | } |
| 59 | |
| 60 | export function stagedFormatFiles(cwd) { |
| 61 | return git( |
| 62 | cwd, |
| 63 | "diff", |
| 64 | "--cached", |
| 65 | "--name-only", |
| 66 | "--no-renames", |
| 67 | "--diff-filter=ACMRT", |
| 68 | "-z", |
| 69 | "--", |
| 70 | ) |
| 71 | .split("\0") |
| 72 | .filter((name) => { |
| 73 | if (!extensions.has(extname(name))) return false; |
| 74 | try { |
| 75 | return lstatSync(resolve(cwd, name)).isFile(); |
| 76 | } catch (error) { |
| 77 | if (error.code === "ENOENT") return false; |
| 78 | throw error; |
| 79 | } |
| 80 | }) |
| 81 | .sort(); |
| 82 | } |
| 83 | |
| 84 | export function changedFormatFiles(cwd, base, head, local = false) { |
| 85 | revision(cwd, base); |
no test coverage detected