Skip to content

Commit

Permalink
Fix save image file
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcos Vinícius Rubido Sauda committed May 25, 2019
1 parent 481ad0a commit bdb3573
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gtmplant",
"version": "0.1.1",
"version": "0.1.2",
"description": "GTM to PlantUML",
"files": [
"dist"
Expand Down
6 changes: 2 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { IGTMWorkspace } from './Interface/GTM/IGTMWorkspace';
const AVAILABLE_PLANTUML_EXTENSIONS: string[] = ['svg', 'png', 'txt'];

commander
.version('0.1.1')
.version('0.1.2')
.option('-i, --input <path>', 'Define the path of the Typescript file')
.option('-o, --output <path>', 'Define the path of the output file. If not defined, it\'ll output on the STDOUT')
.option('-T, --tags', 'Convert tags')
Expand Down Expand Up @@ -60,9 +60,7 @@ function requestImageFile(output: string, input: string, extension: string): voi
path: `/plantuml/${extension}/${encode(input)}`
}, (res: http.IncomingMessage): void => {
// tslint:disable-next-line non-literal-fs-path
const fileStream: fs.WriteStream = fs.createWriteStream(output);
res.setEncoding('binary');
res.pipe(fileStream);
res.pipe(fs.createWriteStream(output));
res.on('error', (err: Error): void => {
throw err;
});
Expand Down

0 comments on commit bdb3573

Please sign in to comment.