Skip to content

Commit

Permalink
Improve wizard names
Browse files Browse the repository at this point in the history
  • Loading branch information
machaval committed May 12, 2021
1 parent 5836377 commit e6e3805
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class DataWeaveCLIRunner {
val grimoiresDirs = grimoires.listFiles()
if (grimoiresDirs != null) {
grimoiresDirs.foreach((g) => {
val name = if (g.getName.equals(DATA_WEAVE_GRIMOIRE_FOLDER)) "" else g.getName + "/"
val name = if (g.getName.equals(DATA_WEAVE_GRIMOIRE_FOLDER)) "" else wizardName(g.getName) + "/"
val spells = g.listFiles()
if (spells != null) {
spells.foreach((s) => {
Expand Down Expand Up @@ -584,7 +584,7 @@ class DataWeaveCLIRunner {
}

def updateGrimoire(grimoire: File): Int = {
println(s"Updating `${grimoire.getName}'s` Grimoire.")
println(s"Updating `${wizardName(grimoire.getName)}'s` Grimoire.")
val processBuilder = new ProcessBuilder("git", "pull")
processBuilder.directory(grimoire)
processBuilder.inheritIO()
Expand All @@ -605,6 +605,13 @@ class DataWeaveCLIRunner {
s"${user}-$DATA_WEAVE_GRIMOIRE_FOLDER"
}

def wizardName(grimoire: String): String = {
if (grimoire == null)
"DW"
else
grimoire.substring(0, grimoire.length - s"-${DATA_WEAVE_GRIMOIRE_FOLDER}")
}

}

class CustomWeaveDataFormat(moduleManager: ModuleLoaderManager) extends WeaveDataFormat {
Expand Down

0 comments on commit e6e3805

Please sign in to comment.