File tree 2 files changed +7
-4
lines changed 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import { Converter } from "../converter";
6
6
import { Context } from "../context" ;
7
7
import { BindOption , readFile } from "../../utils" ;
8
8
import { getCommonDirectory } from "../../utils/fs" ;
9
- import { join } from "path" ;
10
9
11
10
/**
12
11
* A handler that tries to find the package.json and readme.md files of the
@@ -48,7 +47,7 @@ export class PackagePlugin extends ConverterComponent {
48
47
this . packageFile = undefined ;
49
48
50
49
// Path will be resolved already. This is kind of ugly, but...
51
- const noReadmeFile = this . readme == join ( process . cwd ( ) , "none" ) ;
50
+ const noReadmeFile = this . readme . endsWith ( "none" ) ;
52
51
if ( ! noReadmeFile && this . readme ) {
53
52
if ( FS . existsSync ( this . readme ) ) {
54
53
this . readmeFile = this . readme ;
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ export class DefaultTheme extends Theme {
130
130
getUrls ( project : ProjectReflection ) : UrlMapping [ ] {
131
131
const urls : UrlMapping [ ] = [ ] ;
132
132
133
- if ( this . application . options . getValue ( "readme" ) === "none" ) {
133
+ if ( false == hasReadme ( this . application . options . getValue ( "readme" ) ) ) {
134
134
project . url = "index.html" ;
135
135
urls . push ( new UrlMapping ( "index.html" , project , "reflection.hbs" ) ) ;
136
136
} else {
@@ -165,7 +165,7 @@ export class DefaultTheme extends Theme {
165
165
multipleEntryPoints
166
166
) ;
167
167
return builder . build (
168
- this . application . options . getValue ( "readme" ) !== "none"
168
+ hasReadme ( this . application . options . getValue ( "readme" ) )
169
169
) ;
170
170
}
171
171
@@ -581,3 +581,7 @@ export class NavigationBuilder {
581
581
} ) ( reflection ) ;
582
582
}
583
583
}
584
+
585
+ function hasReadme ( readme : string ) {
586
+ return ! readme . endsWith ( "none" ) ;
587
+ }
You can’t perform that action at this time.
0 commit comments