Fix running in backend-only mode (#311)

This commit is contained in:
Nikhil Rao 2023-01-22 09:30:58 -08:00 committed by GitHub
parent 42e3a8b728
commit 58a0d8c805
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 12 deletions

View File

@ -59,15 +59,16 @@ jobs:
key: python-${{ matrix.python-version }}-pydeps-${{ hashFiles('**/poetry.lock') }} key: python-${{ matrix.python-version }}-pydeps-${{ hashFiles('**/poetry.lock') }}
# Begin the integration test # Begin the integration test
- name: Poetry Install # Commenting this out for now while we improve it.
run: poetry install --no-interaction --no-root # - name: Poetry Install
if: steps.cache-deps.outputs.cache-hit != 'true' # run: poetry install --no-interaction --no-root
- name: Install Requirements # if: steps.cache-deps.outputs.cache-hit != 'true'
working-directory: ./pcweb # - name: Install Requirements
run: poetry run pip install -r requirements.txt # working-directory: ./pcweb
- name: Init Website # run: poetry run pip install -r requirements.txt
working-directory: ./pcweb/pcweb # - name: Init Website
run: poetry run pc init # working-directory: ./pcweb
- name: Run Website # run: poetry run pc init
working-directory: ./pcweb/pcweb # - name: Run Website
run: timeout 1m poetry run pc run || exit 0 # working-directory: ./pcweb
# run: timeout 1m poetry run pc run || exit 0

View File

@ -313,6 +313,11 @@ def empty_dir(path: str, keep_files: Optional[List[str]] = None):
path: The path to the directory that will be emptied path: The path to the directory that will be emptied
keep_files: List of filenames or foldernames that will not be deleted. keep_files: List of filenames or foldernames that will not be deleted.
""" """
# If the directory does not exist, return.
if not os.path.exists(path):
return
# Remove all files and folders in the directory.
keep_files = keep_files or [] keep_files = keep_files or []
directory_contents = os.listdir(path) directory_contents = os.listdir(path)
for element in directory_contents: for element in directory_contents: