Commit 19b39a3e by Amelin Konstantin

Rename notValidated and error dirs after converting

parent 44be4a66
......@@ -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" =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment