From d8da1e6dbc4dd5794c595d6455401f53f1010e1a Mon Sep 17 00:00:00 2001 From: eugeneswalker <38933153+eugeneswalker@users.noreply.github.com> Date: Fri, 26 Jun 2020 11:18:29 -0700 Subject: spack ci generate: allow use of --output-file with wo/ preceding path (#17275) --- lib/spack/spack/cmd/ci.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/cmd/ci.py b/lib/spack/spack/cmd/ci.py index d42a3e7ae6..b98bc6ba52 100644 --- a/lib/spack/spack/cmd/ci.py +++ b/lib/spack/spack/cmd/ci.py @@ -38,7 +38,7 @@ def setup_parser(subparser): generate = subparsers.add_parser('generate', help=ci_generate.__doc__) generate.add_argument( '--output-file', default=None, - help="Absolute path to file where generated jobs file should be " + + help="Path to file where generated jobs file should be " + "written. The default is .gitlab-ci.yml in the root of the " + "repository.") generate.add_argument( @@ -88,10 +88,10 @@ def ci_generate(args): use_dependencies = args.dependencies if not output_file: - gen_ci_dir = os.getcwd() - output_file = os.path.join(gen_ci_dir, '.gitlab-ci.yml') + output_file = os.path.abspath(".gitlab-ci.yml") else: - gen_ci_dir = os.path.dirname(output_file) + output_file_path = os.path.abspath(output_file) + gen_ci_dir = os.path.dirname(output_file_path) if not os.path.exists(gen_ci_dir): os.makedirs(gen_ci_dir) -- cgit v1.2.3-70-g09d2