Tell us about your environment
What did you do? Please include the actual source code causing the issue.
markbind init on an empty directory.markbind serve nonExistentRoot (nonExistentRoot/ does not exist on the new website).What did you expect to happen?
The command should fail, since the root directory given does not exist.
What actually happened? Please include the actual, raw output.
MarkBind creates a new folder nonExistentRoot and generates _site/ inside the new folder. It seems to just serve the folder that was just init.
I've made a PR #584 that should address this issue! 馃檪
I believe this change is related to the problem
https://github.com/MarkBind/markbind/pull/202
If we're not careful we may break some features. Will help to investigate. Sorry for the late follow up 馃槗
Seems like the behaviour introduced in https://github.com/MarkBind/markbind/pull/202 allows users to call markbind serve in any sub directory of a markbind site.
However with findUp implementation below:
https://github.com/MarkBind/markbind/blob/b01d1b3dd8cb0eec54df6d2d5c774be7a76c47ec/src/Site.js#L114-L115
It may search for site.json outside of a directory which is undesirable.
Perhaps we should enforce markbind serve to be called at project root?
It may search for site.json outside of a directory which is undesirable.
Are you saying that, with the example below, if I cd to a/b/c/, and do a markbind serve, it might pick up a/b/d/site.json?
a
|-----b
|------c <- I serve inside this directory
|
|------d
|-----site.json
Perhaps we should enforce
markbind serveto be called at project root?
Serving inside a sub directory of a MarkBind website is a convenient feature for the authors, so unless the bug is as severe as the one described above, we should think twice about removing the feature.
Are you saying that, with the example below, if I cd to a/b/c/, and do a markbind serve, it might pick up a/b/d/site.json?
Oh no, i meant the opposite.
a
|-----b
|------c
| |------d <- I serve inside this directory
|-----site.json
Serving in a/b/c/d will detect a/b/site.json. This may be undesirable if there is no site.json in your site and it detects some other site.json at higher level. eg: you have a C:/site.json that may not be even related to markbind.
I think that is fine.
But if [root] in markbind serve [root] is specified, then it should contain site.json.
Most helpful comment
I believe this change is related to the problem
https://github.com/MarkBind/markbind/pull/202
If we're not careful we may break some features. Will help to investigate. Sorry for the late follow up 馃槗