Skip to content

build: silent sass bundling #3784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions tools/gulp/tasks/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ task(':package:theming', [':bundle:theming-scss'],

/** Bundles all scss requires for theming into a single scss file in the root of the package. */
task(':bundle:theming-scss', execNodeTask(
'scss-bundle',
'scss-bundle', [
'-e', themingEntryPointPath,
'-d', themingBundlePath,
]));
'scss-bundle', 'scss-bundle', ['-e', themingEntryPointPath, '-d', themingBundlePath], {
silentStdout: true
}
));

/** Make sure we're logged in. */
task(':publish:whoami', execTask('npm', ['whoami'], {
Expand Down
16 changes: 8 additions & 8 deletions tools/gulp/util/task_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ export function sassBuildTask(dest: string, root: string, minify = false) {

/** Options that can be passed to execTask or execNodeTask. */
export interface ExecTaskOptions {
// Whether to output to STDERR and STDOUT.
// Whether STDOUT and STDERR messages should be printed.
silent?: boolean;
// Whether STDOUT messages should be printed.
silentStdout?: boolean;
// If an error happens, this will replace the standard error.
errMessage?: string;
}
Expand All @@ -65,14 +67,12 @@ export function execTask(binPath: string, args: string[], options: ExecTaskOptio
return (done: (err?: string) => void) => {
const childProcess = child_process.spawn(binPath, args);

if (!options.silent) {
childProcess.stdout.on('data', (data: string) => {
process.stdout.write(data);
});
if (!options.silentStdout && !options.silent) {
childProcess.stdout.on('data', (data: string) => process.stdout.write(data));
}

childProcess.stderr.on('data', (data: string) => {
process.stderr.write(data);
});
if (!options.silent) {
childProcess.stderr.on('data', (data: string) => process.stderr.write(data));
}

childProcess.on('close', (code: number) => {
Expand Down