Skip to content

Commit

Permalink
Use rimraf to remove the temp dir
Browse files Browse the repository at this point in the history
Fixes #56
  • Loading branch information
luisfpg committed Dec 27, 2019
1 parent 7b8391c commit c4b476e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 20 deletions.
3 changes: 2 additions & 1 deletion lib/ng-openapi-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Operation } from './operation';
import { Options } from './options';
import { Service } from './service';
import { Templates } from './templates';
import rimraf from 'rimraf';

/**
* Main generator class
Expand Down Expand Up @@ -96,7 +97,7 @@ export class NgOpenApiGen {
syncDirs(this.tempDir, this.outDir, this.options.removeStaleFiles !== false);

// Finally, remove the temp directory
fs.rmdirSync(this.tempDir, { recursive: true });
rimraf.sync(this.tempDir);

console.info(`Generation from ${this.options.input} finished with ${models.length} models and ${services.length} services.`);
}
Expand Down
53 changes: 35 additions & 18 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@types/lodash": "^4.14.149",
"@types/mkdirp": "^0.5.2",
"@types/node": "^12.12.21",
"@types/rimraf": "^2.0.3",
"argparse": "^1.0.10",
"esm": "^3.2.25",
"fs-extra": "^8.1.0",
Expand All @@ -41,6 +42,7 @@
"json-schema-ref-parser": "^7.1.2",
"lodash": "^4.17.15",
"mkdirp": "^0.5.1",
"rimraf": "^2.7.1",
"ts-node": "^8.5.4",
"typescript": "^3.7.3"
},
Expand All @@ -56,7 +58,6 @@
"mem": "^5.1.1",
"ncp": "^2.0.0",
"replace-in-file": "^4.3.1",
"rimraf": "^2.7.1",
"tslint": "^5.20.1",
"typescript-parser": "^2.6.1"
}
Expand Down

0 comments on commit c4b476e

Please sign in to comment.