Skip to content

Commit

Permalink
Attempt to get virtualenv name from environment
Browse files Browse the repository at this point in the history
  • Loading branch information
brizental committed Nov 18, 2021
1 parent 298131c commit cfbd3c6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions glean/src/cli.ts
Expand Up @@ -14,9 +14,16 @@ import log, { LoggingLevel } from "./core/log.js";

const LOG_TAG = "CLI";

// The name of the directory which will contain the Python virtual environment
// The name of the directory which contains / will contain the Python virtual environment
// used to run the glean-parser.
const VIRTUAL_ENVIRONMENT_DIR = ".venv";
//
// > When a virtual environment is active, the VIRTUAL_ENV environment variable
// > is set to the path of the virtual environment. This can be used to check if
// > one is running inside a virtual environment.
//
// See: https://docs.python.org/3/library/venv.html
// (Also applies to envs created using virtualenv though)
const VIRTUAL_ENVIRONMENT_DIR = process.env.VIRTUAL_ENV?.split("/").slice(-1)[0] || ".venv";

// The version of glean_parser to install from PyPI.
const GLEAN_PARSER_VERSION = "4.1.1";
Expand Down

0 comments on commit cfbd3c6

Please sign in to comment.