Skip to content

Commit

Permalink
fix(api): use proper venv scripts when running on windows
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Shatford <[email protected]>
  • Loading branch information
jordanshatford committed Sep 8, 2023
1 parent 5468116 commit f2e927e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/api/scripts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
import os
import platform
import subprocess
import venv

Expand All @@ -14,6 +15,9 @@
venv_name = 'venv'
venv_dir = os.path.join(cwd, venv_name)
venv_bin = os.path.join(venv_dir, 'bin')
# On windows it appears to be in another directory
if platform.system() == 'Windows':
venv_bin = os.path.join(venv_dir, 'Scripts')
venv_bin_pip = os.path.join(venv_bin, 'pip')
venv.create(venv_dir, with_pip=True)
subprocess.run([venv_bin_pip, 'install', '--upgrade', 'pip'], cwd=cwd)
Expand Down

1 comment on commit f2e927e

@vercel
Copy link

@vercel vercel bot commented on f2e927e Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.