mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 17:28:46 +03:00
ea55ea2d14
Somewhat error-prone, so please review carefully. Reasons we need this: - Some file types are not properly handled by the script. - The only exclusion mechanism we currently have (`NO_AUTO_COPYRIGHT`) is overly coarse. CHANGELOG_BEGIN CHANGELOG_END
43 lines
1.1 KiB
Python
Executable File
43 lines
1.1 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
#
|
|
# Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
"""Bazel aware wrapper for ghcid
|
|
|
|
Calls ghcid on da-ghci on the given target. See da-ghci --help for further information.
|
|
|
|
To pass additional arguments to da-ghci use the following form:
|
|
|
|
da-ghcid //my:target -- -package extra-package
|
|
|
|
"""
|
|
|
|
import argparse
|
|
import subprocess
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
|
|
parser.add_argument(
|
|
"--data",
|
|
action="store",
|
|
dest="data",
|
|
choices=["yes","no"],
|
|
help="Whether to load data dependencies into the REPL.")
|
|
|
|
args, remainingArgs = parser.parse_known_args()
|
|
|
|
if args.data == None:
|
|
ghciCmd = "da-ghci"
|
|
else:
|
|
ghciCmd = f"da-ghci --data {args.data}"
|
|
|
|
try:
|
|
subprocess.call(["ghcid","-c",ghciCmd] + remainingArgs)
|
|
except KeyboardInterrupt:
|
|
return # don't give a trace back, just exit
|
|
|
|
if __name__ == "__main__":
|
|
main()
|