How to use the @absolunet/terminal.terminal.runAndGet 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
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`
		}];
	}