Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SPB_Exchange_Repo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Amelin Konstantin
SPB_Exchange_Repo
Commits
19b39a3e
Commit
19b39a3e
authored
Sep 28, 2020
by
Amelin Konstantin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename notValidated and error dirs after converting
parent
44be4a66
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
src/main/scala/Main.scala
+15
-5
No files found.
src/main/scala/Main.scala
View file @
19b39a3e
...
...
@@ -49,15 +49,15 @@ object Main {
val
sourceNameValidated
=
s
"${args(0)}/${start}_validated"
val
sourceValidated
=
Try
{
Files
.
createDirectory
(
Paths
.
get
(
sourceNameValidated
))
}
val
sourceNameNotValidated
=
s
"${args(0)}/${start}_
not_validated
"
val
sourceNameNotValidated
=
s
"${args(0)}/${start}_
temp_nv
"
val
sourceNotValidated
=
Try
{
Files
.
createDirectory
(
Paths
.
get
(
sourceNameNotValidated
))
}
val
sourceNameError
=
s
"${args(0)}/
error
_$start"
val
sourceNameError
=
s
"${args(0)}/
temp_e
_$start"
val
sourceError
=
Try
{
Files
.
createDirectory
(
Paths
.
get
(
sourceNameError
))
}
val
createDirRes
=
for
{
sv
<-
sourceValidated
snv
<-
sourceNotValidated
_
<-
sourceValidated
_
<-
sourceNotValidated
se
<-
sourceError
}
yield
se
...
...
@@ -196,7 +196,17 @@ object Main {
Files
.
delete
(
sourceValidated
.
get
)
if
(
Files
.
list
(
sourceNotValidated
.
get
).
iterator
.
asScala
.
isEmpty
)
Files
.
delete
(
sourceNotValidated
.
get
)
else
{
val
sourceNameNotValidatedFinal
=
s
"${args(0)}/${start}_not_validated"
Files
.
move
(
sourceNotValidated
.
get
,
Paths
.
get
(
sourceNameNotValidatedFinal
))
}
if
(
Files
.
list
(
sourceError
.
get
).
iterator
.
asScala
.
isEmpty
)
Files
.
delete
(
sourceError
.
get
)
else
{
val
sourceNameErrorFinal
=
s
"${args(0)}/error_$start"
Files
.
move
(
sourceError
.
get
,
Paths
.
get
(
sourceNameErrorFinal
))
}
}
match
{
case
Success
(
_
)
=>
println
(
s
"Converting has been finished. $logFileName located in ${args(0)}"
)
...
...
@@ -212,7 +222,7 @@ object Main {
implicit
def
templateFactory
(
source
:
Node
)
:
Template
=
{
Try
{
(
source
\\
"trade"
).
head
.
child
.
filter
{
case
v
:
Elem
=>
true
case
_
:
Elem
=>
true
case
_
=>
false
}(
1
).
label
}
match
{
case
Success
(
v
)
if
v
==
"repo"
=>
...
...
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