Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
areFilesGitTracked(files, pathname, { root = '' }) {
const rawFiles = files.map((file) => { return `${pathname}/${file}`; });
const trackedFiles = terminal.runAndRead(`cd ${paths.directory.root}/${root}; git ls-files ${pathname}`).split('\n');
const differences = toolbox.compareLists(trackedFiles, rawFiles);
return {
success: differences.missing.length === 0,
message: `${Reporter.theme.title(pathname)}: All files must be tracked by git`,
differences: { missing: differences.missing }
};
}