0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Log "Building client" message until client build finishes (#9611)

no issue

- display "Building admin client... (can take ~1min)" every 5 seconds when running `grunt dev` until the ember build finishes so that it's clear the command is still busy
This commit is contained in:
Kevin Ansfield 2018-04-30 20:16:24 +01:00 committed by Katharina Irrgang
parent 97c833e9ff
commit eef2d0bbb0

View file

@ -25,6 +25,14 @@ var config = require('./core/server/config'),
buildDirectory = path.resolve(cwd, '.build'),
distDirectory = path.resolve(cwd, '.dist'),
hasBuiltClient = false,
logBuildingClient = function (grunt) {
if (!hasBuiltClient) {
grunt.log.writeln('Building admin client... (can take ~1min)');
setTimeout(logBuildingClient, 5000, grunt);
}
},
// ## Grunt configuration
configureGrunt = function (grunt) {
@ -202,7 +210,10 @@ var config = require('./core/server/config'),
bgShell: {
client: {
cmd: 'grunt subgrunt:watch',
cmd: function () {
logBuildingClient(grunt);
return 'grunt subgrunt:watch';
},
bg: grunt.option('client') ? false : true,
stdout: function (chunk) {
// hide certain output to prevent confusion when running alongside server
@ -217,6 +228,10 @@ var config = require('./core/server/config'),
if (!filter) {
grunt.log.write(chunk);
}
if (chunk.indexOf('Build successful') !== -1) {
hasBuiltClient = true;
}
},
stderr: true
}