Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
caddy
Commits
782ba324
Commit
782ba324
authored
9 years ago
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only a warning if site root doesn't exist
parent
d1181972
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
config/directives.go
config/directives.go
+7
-3
No files found.
config/directives.go
View file @
782ba324
package
config
package
config
import
(
import
(
"fmt"
"log"
"os"
"os"
"os/exec"
"os/exec"
...
@@ -30,12 +32,14 @@ func init() {
...
@@ -30,12 +32,14 @@ func init() {
p
.
cfg
.
Root
=
p
.
tkn
()
p
.
cfg
.
Root
=
p
.
tkn
()
// Ensure root folder exists
// Ensure root folder exists
_
,
err
:=
os
.
Stat
(
p
.
cfg
.
Root
)
_
,
err
:=
os
.
Open
(
p
.
cfg
.
Root
)
if
err
!=
nil
{
if
err
!=
nil
{
if
os
.
IsNotExist
(
err
)
{
if
os
.
IsNotExist
(
err
)
{
return
p
.
err
(
"Path"
,
"Root path "
+
p
.
cfg
.
Root
+
" does not exist"
)
// Allow this, because the folder might appear later.
// But make sure the user knows!
log
.
Printf
(
"Warning: Root path %s does not exist"
,
p
.
cfg
.
Root
)
}
else
{
}
else
{
return
p
.
err
(
"Path"
,
"Unable to access root path "
+
p
.
cfg
.
Root
)
return
p
.
err
(
"Path"
,
fmt
.
Sprintf
(
"Unable to access root path '%s': %s"
,
p
.
cfg
.
Root
,
err
.
Error
())
)
}
}
}
}
return
nil
return
nil
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment