Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gitTracked(pathname, { root = '', tracked = true } = {}) {
const isTracked = Boolean(terminal.runAndGet(`cd ${paths.directory.root}/${root}; git ls-files ${pathname}`));
return [{
type: 'gitTracked',
success: (tracked && isTracked) || (!tracked && !isTracked),
message: `${Reporter.theme.title(pathname)}: Must${tracked ? '' : ' not'} be tracked by git`
}];
}