Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ebulk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
ebulk
Commits
9de1e703
Commit
9de1e703
authored
Oct 16, 2020
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixing: check invalid dataset name before store it in local config file
- fix indentation
parent
5775db93
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
9 deletions
+32
-9
ebulk
ebulk
+32
-9
No files found.
ebulk
View file @
9de1e703
...
@@ -62,6 +62,7 @@ function helpReadme {
...
@@ -62,6 +62,7 @@ function helpReadme {
}
}
function
checkParameters
{
function
checkParameters
{
re
=
'^[_A-Za-z.0-9-]*$'
if
[
!
-f
$TEMPLATE_FILE
]
;
then
if
[
!
-f
$TEMPLATE_FILE
]
;
then
echo
echo
echo
-e
"
${
ORANGE
}
[ERROR] File '
$TEMPLATE_FILE
' not found!
${
NC
}
"
>
&2
;
return
1
echo
-e
"
${
ORANGE
}
[ERROR] File '
$TEMPLATE_FILE
' not found!
${
NC
}
"
>
&2
;
return
1
...
@@ -91,6 +92,19 @@ function checkParameters {
...
@@ -91,6 +92,19 @@ function checkParameters {
fi
fi
fi
fi
EBULK_DATASET_FILE
=
"
$DATASET_DIR$EBULK_DATASET_FILE_NAME
"
EBULK_DATASET_FILE
=
"
$DATASET_DIR$EBULK_DATASET_FILE_NAME
"
if
!
[[
$REFERENCE
=
~
$re
]]
;
then
if
[
"
$REFERENCE
"
=
"."
]
&&
[[
-z
"
$STORAGE
"
]]
;
then
echo
echo
-e
"
${
ORANGE
}
[ERROR] You are not in a dataset directory
${
GREEN
}
'
$REFERENCE
'
${
ORANGE
}
.
${
NC
}
"
echo
else
echo
echo
-e
"
${
ORANGE
}
[ERROR] Error in argument: invalid dataset name
${
GREEN
}
'
$REFERENCE
'
${
ORANGE
}
.
${
NC
}
"
echo
-e
"
${
ORANGE
}
[ERROR] Only alphanumerics, dots ( . ), underscores ( _ ) and hyphens ( - ) are allowed.
${
NC
}
"
echo
fi
helpReadme
>
&2
;
return
1
fi
if
[[
$DATASET_DIR
!=
$REFERENCE
]]
;
then
if
[[
$DATASET_DIR
!=
$REFERENCE
]]
;
then
if
[
"
$REFERENCE
"
=
"."
]
;
then
if
[
"
$REFERENCE
"
=
"."
]
;
then
REFERENCE
=
$(
basename
"
$DATASET_DIR
"
)
REFERENCE
=
$(
basename
"
$DATASET_DIR
"
)
...
@@ -124,7 +138,6 @@ function checkParameters {
...
@@ -124,7 +138,6 @@ function checkParameters {
if
[
"
$DATA_SET
"
==
"."
]
;
then
if
[
"
$DATA_SET
"
==
"."
]
;
then
DATA_SET
=
$(
basename
$(
pwd
))
DATA_SET
=
$(
basename
$(
pwd
))
fi
fi
re
=
'^[_A-Za-z.0-9-]*$'
if
!
[[
$DATA_SET
=
~
$re
]]
;
then
if
!
[[
$DATA_SET
=
~
$re
]]
;
then
if
[
"
$DATA_SET
"
=
"."
]
&&
[[
-z
"
$STORAGE
"
]]
;
then
if
[
"
$DATA_SET
"
=
"."
]
&&
[[
-z
"
$STORAGE
"
]]
;
then
echo
echo
...
@@ -750,6 +763,9 @@ case $OPERATION in
...
@@ -750,6 +763,9 @@ case $OPERATION in
echo
echo
fi
fi
echo
"### DATASET DOWNLOAD ###"
echo
"### DATASET DOWNLOAD ###"
if
[
"
$ALWAYS_YES
"
=
"true"
]
;
then
echo
"[always yes mode]"
fi
echo
echo
if
[
"
$DISCARD_CHANGES
"
!=
""
]
;
then
if
[
"
$DISCARD_CHANGES
"
!=
""
]
;
then
DISCARD_CHANGES_FILE
=
"
$DATASET_DIR$DISCARD_CHANGES_FILE_NAME
"
DISCARD_CHANGES_FILE
=
"
$DATASET_DIR$DISCARD_CHANGES_FILE_NAME
"
...
@@ -759,8 +775,10 @@ case $OPERATION in
...
@@ -759,8 +775,10 @@ case $OPERATION in
echo
-e
"** The dataset will be downloaded in the specified directory:
$DATASET_DIR
"
echo
-e
"** The dataset will be downloaded in the specified directory:
$DATASET_DIR
"
fi
fi
echo
echo
if
[
"
$ALWAYS_YES
"
=
"false"
]
;
then
read
-n
1
-s
-r
-p
"Press any key to continue"
read
-n
1
-s
-r
-p
"Press any key to continue"
echo
echo
fi
runProcess
runProcess
;;
;;
push
)
push
)
...
@@ -799,11 +817,16 @@ case $OPERATION in
...
@@ -799,11 +817,16 @@ case $OPERATION in
esac
esac
fi
fi
echo
"### DATASET INGESTION ###"
echo
"### DATASET INGESTION ###"
if
[
"
$ALWAYS_YES
"
=
"true"
]
;
then
echo
"[always yes mode]"
else
echo
echo
echo
-e
"** The tool will look for dataset files in the specified
$MESSAGE
"
echo
-e
"** The tool will look for dataset files in the specified
$MESSAGE
"
echo
-e
"** Please make sure to put your dataset files there for ingestion."
echo
-e
"** Please make sure to put your dataset files there for ingestion."
echo
echo
read
-n
1
-s
-r
-p
"Press any key to continue"
read
-n
1
-s
-r
-p
"Press any key to continue"
fi
echo
echo
runProcess
runProcess
;;
;;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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