From 7b6ea994b817c2563c75d2b29bcb5d43813de712 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 27 Jun 2017 10:08:16 -0700 Subject: [PATCH] Expose --source and --origin as environment variables --- pre_commit/commands/run.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py index aa9bb1e2..a8e61193 100644 --- a/pre_commit/commands/run.py +++ b/pre_commit/commands/run.py @@ -220,6 +220,11 @@ def run(runner, args, environ=os.environ): ) return 1 + # Expose origin / source as environment variables for hooks to consume + if args.origin and args.source: + environ['PRE_COMMIT_ORIGIN'] = args.origin + environ['PRE_COMMIT_SOURCE'] = args.source + if no_stash: ctx = noop_context() else: