Skip to content

Commit fa9f8b2

Browse files
authored
Merge pull request #2688 from dotty-staging/fix/default-project-name
Remove default project names, fixing weird dirs crashing dotty-doc
2 parents a082b9c + 43065e1 commit fa9f8b2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class ScalaSettings extends Settings.SettingGroup {
121121
"-project",
122122
"project title",
123123
"The name of the project",
124-
sys.props("user.dir").split(File.separatorChar).last
124+
""
125125
)
126126

127127
val projectVersion = StringSetting (

doc-tool/src/dotty/tools/dottydoc/DocDriver.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ class DocDriver extends Driver {
4848
val projectVersion = ctx.settings.projectVersion.value
4949
val projectUrl = ctx.settings.projectUrl.value
5050

51-
if (!siteRoot.exists || !siteRoot.isDirectory)
51+
if (projectName.isEmpty)
52+
ctx.error(s"Site project name not set. Use `-project <title>` to set the project name")
53+
else if (!siteRoot.exists || !siteRoot.isDirectory)
5254
ctx.error(s"Site root does not exist: $siteRoot")
5355
else {
5456
Site(siteRoot, projectName, projectVersion, projectUrl, ctx.docbase.packages)

0 commit comments

Comments
 (0)