This repository was archived by the owner on Jun 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,12 @@ def init():
4242
4343def build ():
4444 from paver .tasks import main as paver_main
45+ os .chdir (findProjectRoot ())
4546 sys .argv [0 ] = "build"
4647 paver_main ()
4748
4849def serve ():
50+ os .chdir (findProjectRoot ())
4951 sys .path .insert (0 ,os .getcwd ())
5052 try :
5153 import pavement
@@ -76,7 +78,7 @@ def main(args=None):
7678 args = sys .argv [1 :]
7779 foo_config = resource_filename ('runestone' , 'common' )
7880# foo_string = resource_string('runestone', 'project/template/conf.tmpl')
79- print ( findProjectRoot ())
81+
8082 if args [0 ] == "init" :
8183 init ()
8284 elif args [0 ] == "build" :
@@ -88,11 +90,13 @@ def main(args=None):
8890
8991def findProjectRoot ():
9092 start = os .getcwd ()
91- done = False
92- while start != "/" :
93+ prevdir = ""
94+ while start != prevdir :
9395 if os .path .exists (os .path .join (start ,'pavement.py' )):
9496 return start
97+ prevdir = start
9598 start = os .path .dirname (start )
99+ raise NotADirectoryError ("You must be in a runestone project to run runestone" )
96100
97101if __name__ == "__main__" :
98102 sys .exit (main (sys .argv [1 :]))
You can’t perform that action at this time.
0 commit comments