mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-17 07:50:12 +01:00
Gh pages deploy fix (#5669)
* fix(app):redirect after 404 * fix(app):docs building script * fix(app):add gulpfile for docs * fix(app): directory splitting * fix(app): build docs script * fix(app): build docs script * fix(app): build docs script * fix(app): relative path for scss * fix(app): relative path for scss * fix(app): relative path for scss * fix(app):fix footer icons * fix(app):fix footer icons * fix(app):fix footer icons * fix(app):config * fix(app):remove small-social * fix(docs): footer icons style * fix(docs): material page index file * fix(docs): descriptions and keyword * fix(docs): og description * fix(docs): og description and title * fix(docs): dem,o branch url * fix(docs): dynamic title for docs page * fix(docs): remove unused script * fix(docs): static title Co-authored-by: Evgeny Lupanov <e.lupanov@akveo.com>
This commit is contained in:
parent
5cfe9dee9c
commit
63ac65eada
26 changed files with 3723 additions and 61 deletions
37
scripts/docs/run-command.ts
Normal file
37
scripts/docs/run-command.ts
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import { exec } from 'child_process';
|
||||
import { promisify } from 'util';
|
||||
|
||||
export interface RunCommandOptions {
|
||||
cwd?: string;
|
||||
showLog?: boolean;
|
||||
}
|
||||
|
||||
const DEFAULT_OPTIONS: RunCommandOptions = { cwd: process.cwd(), showLog: false };
|
||||
|
||||
export async function runCommand(command: string, options?: RunCommandOptions) {
|
||||
let { cwd, showLog } = Object.assign({}, DEFAULT_OPTIONS, options);
|
||||
|
||||
try {
|
||||
console.log(`Running "${command}" in "${cwd}"`);
|
||||
const { stdout, stderr } = await promisify(exec)(command, { cwd });
|
||||
|
||||
if (showLog && stdout) {
|
||||
console.log(stdout);
|
||||
}
|
||||
|
||||
if (stderr) {
|
||||
console.log(`stderr from "${command}" in "${cwd}"`);
|
||||
console.warn(stderr);
|
||||
}
|
||||
} catch ({ message, stdout, stderr }) {
|
||||
let errorMessage = `Error running "${command}" in "${cwd}": ${message}.`;
|
||||
if (stdout) {
|
||||
errorMessage += `\nstdout: ${stdout}`;
|
||||
console.error(stdout);
|
||||
}
|
||||
if (stderr) {
|
||||
errorMessage += `\nstderr: ${stderr}`;
|
||||
}
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue