How to use the @absolunet/terminal.terminal.runAndRead function in @absolunet/terminal

To help you get started, we’ve selected a few @absolunet/terminal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github absolunet / nwayo / packages / workflow / helpers / doctor / assertions.js View on Github external
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 }
		};
	}