Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tomotools
Nabu
Commits
21ec88d2
Commit
21ec88d2
authored
Apr 30, 2021
by
Pierre Paleo
Browse files
nabu-config: Force absolute dataset path
parent
f6b33baf
Changes
1
Hide whitespace changes
Inline
Side-by-side
nabu/resources/cli/bootstrap.py
View file @
21ec88d2
...
...
@@ -2,7 +2,6 @@ from os import path
from
.utils
import
parse_params_values
from
.cli_configs
import
BootstrapConfig
from
...io.config
import
generate_nabu_configfile
from
..validators
import
convert_to_bool
def
parse_sections
(
sections
):
sections
=
sections
.
lower
()
...
...
@@ -38,11 +37,18 @@ def bootstrap():
prefilled_values
=
{}
if
args
[
"dataset"
]
!=
""
:
prefilled_values
[
"dataset"
]
=
{}
prefilled_values
[
"dataset"
][
"location"
]
=
args
[
"dataset"
]
user_dataset
=
args
[
"dataset"
]
if
not
path
.
isabs
(
user_dataset
):
user_dataset
=
path
.
abspath
(
user_dataset
)
print
(
"Warning: using absolute dataset path %s"
%
user_dataset
)
if
not
path
.
exists
(
user_dataset
):
print
(
"Error: cannot find the file or directory %s"
%
user_dataset
)
exit
(
1
)
prefilled_values
[
"dataset"
][
"location"
]
=
user_dataset
generate_nabu_configfile
(
args
[
"output"
],
comments
=
not
(
no_comments
),
options_level
=
args
[
"level"
],
prefilled_values
=
prefilled_values
,
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment