tasks/dockerCompose.js
function servicesRunning() {
			var composeArgs = ['ps'];

			// If we're tailing just the main service's logs, then we only check that service
			if (service === '<%= dockerCompose.options.mainService %>') {
				composeArgs.push(grunt.config.get('dockerCompose.options.mainService'));
			}

			// get the stdout of docker-compose ps, store as Array, and drop the header lines.
			var serviceList = spawn('docker-compose', composeArgs).stdout.toString().split('\n').slice(2),
				upCount = 0;

			// if we are left with 1 line or less, then nothing is running.
			if (serviceList.length <= 1) {
				return false;
			}

			function isUp(service) {
				if (service.indexOf('Up') > 0) {
					upCount++;
				}
			}

			serviceList.forEach(isUp);

			return upCount > 0;
		}
function servicesRunning() {
			var composeArgs = ['ps'];

			// If we're tailing just the main service's logs, then we only check that service
			if (service === '<%= dockerCompose.options.mainService %>') {
				composeArgs.push(grunt.config.get('dockerCompose.options.mainService'));
			}

			// get the stdout of docker-compose ps, store as Array, and drop the header lines.
			var serviceList = spawn('docker-compose', composeArgs).stdout.toString().split('\n').slice(2),
				upCount = 0;

			// if we are left with 1 line or less, then nothing is running.
			if (serviceList.length <= 1) {
				return false;
			}

			function isUp(service) {
				if (service.indexOf('Up') > 0) {
					upCount++;
				}
			}

			serviceList.forEach(isUp);

			return upCount > 0;
		}
function servicesRunning ( ) { var composeArgs = [ 'ps' ] ; // If we're tailing just the main service's logs, then we only check that service if ( service === '<%= dockerCompose.options.mainService %>' ) { composeArgs . push ( grunt . config . get ( 'dockerCompose.options.mainService' ) ) ; } // get the stdout of docker-compose ps, store as Array, and drop the header lines. var serviceList = spawn ( 'docker-compose' , composeArgs ) . stdout . toString ( ) . split ( '\n' ) . slice ( 2 ) , upCount = 0 ; // if we are left with 1 line or less, then nothing is running. if ( serviceList . length <= 1 ) { return false ; } function isUp ( service ) { if ( service . indexOf ( 'Up' ) > 0 ) { upCount ++ ; } } serviceList . forEach ( isUp ) ; return upCount > 0 ; }
do we have any services running?
do we have any services running?