Skip to content

Commit

Permalink
Finalize stream output
Browse files Browse the repository at this point in the history
  • Loading branch information
henryruhs committed Jan 10, 2023
1 parent 8d86cca commit 5c3846e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/core.class.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os from 'os';
import { EOL } from 'os';
import fs from 'fs';
import PATH, { dirname, basename } from 'path';
import glob from 'glob';
Expand All @@ -10,7 +10,8 @@ import { Options } from './option.interface';

export class Core
{
metadataObject : Metadata = this.helper.readJsonFromAbsolutePath('./assets/metadata.json') as Metadata;
protected metadataObject : Metadata = this.helper.readJsonFromAbsolutePath('./assets/metadata.json') as Metadata;
protected stream : NodeJS.WriteStream = process.stdout;

constructor(
protected helper : Helper,
Expand All @@ -21,11 +22,10 @@ export class Core

init() : void
{
this.cut(this.analyse()).map(chunk => fs.cp(chunk.filePath, chunk.chunkPath,
{
recursive: true
}, () => process.stdout.write('.')));
process.stdout.write(os.EOL);
this.cut(this.analyse())
.map(chunk => fs.cpSync(chunk.filePath, chunk.chunkPath))
.map(() => this.stream.write('.'));
this.stream.write(EOL);
}

cli(process : NodeJS.Process) : void
Expand All @@ -50,7 +50,7 @@ export class Core

analyse() : Data
{
const { path, specPattern } : Options = this.option.getAll();
const { specPattern, path } : Options = this.option.getAll();
const data : Data =
{
files: [],
Expand Down

0 comments on commit 5c3846e

Please sign in to comment.