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:
parent
97c833e9ff
commit
eef2d0bbb0
1 changed files with 16 additions and 1 deletions
17
Gruntfile.js
17
Gruntfile.js
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue