Skip to content

Commit

Permalink
Update Evidence commands
Browse files Browse the repository at this point in the history
  • Loading branch information
thedatadavis committed Sep 7, 2024
1 parent 9b94bf2 commit 40711d2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
30 changes: 26 additions & 4 deletions dar/dar/evidence_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,33 @@ def evidence_cli():
"""Evidence command wrapper"""
pass


@evidence_cli.command()
def run_sources():
"""Run Evidence sources"""
def build():
"""Generate Evidence static files"""
os.chdir('reports')
subprocess.run(["npm", "run", "sources"])
subprocess.run(["npm", "run", "build"])
os.chdir('..')

@evidence_cli.command()
def preview():
"""Run Evidence dev server"""
os.chdir('reports')
subprocess.run(["npm", "run", "dev"])
os.chdir('..')

# Add more Evidence commands as needed
# TODO: Add refresh command that copies compiled dbt models to Evidence source folder
@evidence_cli.command()
def refresh():
"""Copy dbt models to Evidence"""
# os.chdir('reports')
# subprocess.run(["npm", "run", "sources"])
# os.chdir('..')
pass

@evidence_cli.command()
def update():
"""Run Evidence sources"""
os.chdir('reports')
subprocess.run(["npm", "run", "sources"])
os.chdir('..')
9 changes: 9 additions & 0 deletions dar/dar/site_commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Purpose: Copy compiled static files to the site folder
import click
import subprocess
import os

@click.group()
def site_cli():
"""Site command wrapper"""
pass

0 comments on commit 40711d2

Please sign in to comment.