From 6413296939907eb0abcee33812f41a787d03d282 Mon Sep 17 00:00:00 2001 From: Schneems Date: Wed, 27 Nov 2024 20:45:13 -0600 Subject: [PATCH] Expand `with_contents_dir` to absolute path Previously if you tried using `--with-contents .` you would not get expected behavior. Close #81 --- CHANGELOG.md | 2 ++ lib/rundoc/cli_argument_parser.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 132885c..4b6a519 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## HEAD +- Fix: `rundoc --with-contents ` now expands the path passed in to the `--with-contents` so relative paths can safely be used (https://github.com/zombocom/rundoc/pull/83) + ## 3.1.1 - Fix: Include all code sections in the event of a failure, not just the last one (https://github.com/zombocom/rundoc/pull/71) diff --git a/lib/rundoc/cli_argument_parser.rb b/lib/rundoc/cli_argument_parser.rb index 9f7bf08..8ba3b4e 100644 --- a/lib/rundoc/cli_argument_parser.rb +++ b/lib/rundoc/cli_argument_parser.rb @@ -111,7 +111,7 @@ def call end opts.on("--with-contents ", "Copies contents of directory into the tmp working dir") do |v| - options[:with_contents_dir] = v + options[:with_contents_dir] = File.expand_path(v) end opts.on("--on-success-dir ", "Success dir, relative to CWD. i.e. `/#{CLI::DEFAULTS::ON_SUCCESS_DIR}/`.") do |v|