Skip to content

Commit 2f95944

Browse files
committed
Bazel: add documentation to install.py
1 parent 2f53c0e commit 2f95944

1 file changed

Lines changed: 20 additions & 6 deletions

File tree

misc/bazel/internal/install.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
"""
2+
Helper script for installing `codeql_pack` targets.
3+
4+
This mainly wraps around a `pkg_install` script from `rules_pkg` adding:
5+
* resolving destination directory with respect to a provided `--build-file`
6+
* clean-up of target destination directory before a reinstall
7+
* installing imported zip files using a provided `--ripunzip`
8+
"""
9+
110
import argparse
211
import pathlib
312
import shutil
@@ -7,12 +16,17 @@
716
runfiles = runfiles.Create()
817
assert runfiles, "Installer should be run with `bazel run`"
918

10-
parser = argparse.ArgumentParser()
11-
parser.add_argument("--destdir", type=pathlib.Path, required=True)
12-
parser.add_argument("--script", required=True)
13-
parser.add_argument("--build-file", required=True)
14-
parser.add_argument("--ripunzip", required=True)
15-
parser.add_argument("--zip-manifest", action="append", default=[], dest="zip_manifests")
19+
parser = argparse.ArgumentParser(description=__doc__)
20+
parser.add_argument("--destdir", type=pathlib.Path, required=True,
21+
help="Desination directory, relative to `--build-file`")
22+
parser.add_argument("--script", required=True,
23+
help="The wrapped `pkg_install` installation script rlocation")
24+
parser.add_argument("--build-file", required=True,
25+
help="BUILD.bazel rlocation relative to which the installation should take place")
26+
parser.add_argument("--ripunzip", required=True,
27+
help="ripunzip executable rlocation")
28+
parser.add_argument("--zip-manifest", action="append", default=[], dest="zip_manifests",
29+
help="The rlocation of a file containing newline-separated `prefix:zip_file` entries")
1630
opts = parser.parse_args()
1731

1832
build_file = runfiles.Rlocation(opts.build_file)

0 commit comments

Comments
 (0)