File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -7201,6 +7201,13 @@ var td;
72017201 */
72027202 Renderer . prototype . prepareOutputDirectory = function ( directory ) {
72037203 if ( td . FS . existsSync ( directory ) ) {
7204+ if ( ! td . FS . statSync ( directory ) . isDirectory ( ) ) {
7205+ this . application . logger . error ( 'The output target "%s" exists but it is not a directory.' , directory ) ;
7206+ return false ;
7207+ }
7208+ if ( td . FS . readdirSync ( directory ) . length == 0 ) {
7209+ return true ;
7210+ }
72047211 if ( ! this . theme . isOutputDirectory ( directory ) ) {
72057212 this . application . logger . error ( 'The output directory "%s" exists but does not seem to be a documentation generated by TypeDoc.\n' +
72067213 'Make sure this is the right target directory, delete the folder and rerun TypeDoc.' , directory ) ;
Original file line number Diff line number Diff line change @@ -258,6 +258,17 @@ module td.output
258258 */
259259 private prepareOutputDirectory ( directory :string ) :boolean {
260260 if ( FS . existsSync ( directory ) ) {
261+ if ( ! FS . statSync ( directory ) . isDirectory ( ) ) {
262+ this . application . logger . error (
263+ 'The output target "%s" exists but it is not a directory.' ,
264+ directory ) ;
265+ return false ;
266+ }
267+
268+ if ( FS . readdirSync ( directory ) . length == 0 ) {
269+ return true ;
270+ }
271+
261272 if ( ! this . theme . isOutputDirectory ( directory ) ) {
262273 this . application . logger . error (
263274 'The output directory "%s" exists but does not seem to be a documentation generated by TypeDoc.\n' +
You can’t perform that action at this time.
0 commit comments