main does it all from the root directory

This commit is contained in:
Anish Lakhwara 2022-02-26 22:24:38 +10:00
parent 888afdb76c
commit e21daaf521

View file

@ -1,9 +1,12 @@
from grab import makePublic from grab import makePublic
from shared import TagHelper from shared import TagHelper
from build import build from build import build
import os
def grab(): def grab():
# We're in src/kitaab-public/
os.chdir('./grab/')
all_files = TagHelper.getAllFiles() all_files = TagHelper.getAllFiles()
filtered_files = makePublic.filterFiles(all_files) filtered_files = makePublic.filterFiles(all_files)
makePublic.copyFiles(filtered_files) makePublic.copyFiles(filtered_files)
@ -12,16 +15,17 @@ def grab():
def build_website(): def build_website():
# we're in src/kitaab-public/grab/
os.chdir('../')
print('building websites') print('building websites')
build.generate_website() build.generate_website()
def main(): def main():
print('in main')
grab() grab()
print('going to build')
build_website() build_website()
if __name__ == '__main__': if __name__ == '__main__':
os.chdir('./src/kitaab-public/')
main() main()