JSRocksHQ / harmonic

The next static site generator
http://harmonicjs.com/
MIT License
282 stars 26 forks source link

Run harmonic commands in subdirectories of an Harmonic site #111

Closed UltCombo closed 9 years ago

UltCombo commented 9 years ago

Use case

Assume I've created an Harmonic site at /site/. After fiddling a bit in the terminal, my CWD is /site/posts/en/. If I try to run any Harmonic command (e.g. harmonic run) it will throw the "this is not an Harmonic project yet" error.


I believe we can walk up the directory hierarchy to find the closest harmonic.json file and assume it is the root of the Harmonic site. This approach is used by jshint, jscs, npm, git, etc.

IIRC there is an npm package that implements this functionality, but anyway we would only need a couple lines of code to cover our use cases I believe.

UltCombo commented 9 years ago

Fixed by #139