summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoreugeneswalker <38933153+eugeneswalker@users.noreply.github.com>2020-06-26 11:18:29 -0700
committerGitHub <noreply@github.com>2020-06-26 11:18:29 -0700
commitd8da1e6dbc4dd5794c595d6455401f53f1010e1a (patch)
treefb8dbb78f8a1a2af32a7d961d087f075ea24e749 /lib
parent1602b7a56192c23fb7fc110a1c8a17ec0837bdd3 (diff)
downloadspack-d8da1e6dbc4dd5794c595d6455401f53f1010e1a.tar.gz
spack-d8da1e6dbc4dd5794c595d6455401f53f1010e1a.tar.bz2
spack-d8da1e6dbc4dd5794c595d6455401f53f1010e1a.tar.xz
spack-d8da1e6dbc4dd5794c595d6455401f53f1010e1a.zip
spack ci generate: allow use of --output-file <file> with wo/ preceding path (#17275)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/ci.py8
1 files changed, 4 insertions, 4 deletions
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)