summaryrefslogtreecommitdiff
path: root/subplot/bumper.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-28 17:13:27 +0300
committerLars Wirzenius <liw@liw.fi>2021-03-29 10:38:23 +0300
commit3783b6ace86957c95e5137c7645af319dd2462e9 (patch)
treef4649980e94680e9c277611e4c7b7988d0591f96 /subplot/bumper.py
parent53db547b3a4dc45aaa33b24f5b85da1e3397a38d (diff)
downloadbumper-rs-3783b6ace86957c95e5137c7645af319dd2462e9.tar.gz
feat: set version in Cargo.toml for Rust projects
Diffstat (limited to 'subplot/bumper.py')
-rw-r--r--subplot/bumper.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/subplot/bumper.py b/subplot/bumper.py
index 0e6a0ef..3198e13 100644
--- a/subplot/bumper.py
+++ b/subplot/bumper.py
@@ -34,6 +34,22 @@ def run_command_in_directory(ctx, dirname=None, argv0=None, args=None):
runcmd_exit_code_is_zero(ctx)
+def try_to_run_command_in_directory(ctx, dirname=None, argv0=None, args=None):
+ runcmd_run = globals()["runcmd_run"]
+
+ argv = [shlex.quote(argv0)] + shlex.split(args)
+ runcmd_run(ctx, argv, cwd=dirname)
+
+
+def only_these_files_exist_in(ctx, filenames=None, dirname=None):
+ assert_eq = globals()["assert_eq"]
+ expect = list(sorted(x for x in filenames.replace(",", "").split() if x != "and"))
+ actual = list(sorted(os.listdir(dirname)))
+ logging.debug(f"expect files; {expect}")
+ logging.debug(f"actual files; {actual}")
+ assert_eq(expect, actual)
+
+
def git_tag_points_at(ctx, dirname=None, tag=None, varname=None):
runcmd_run = globals()["runcmd_run"]
runcmd_get_stdout = globals()["runcmd_get_stdout"]