Skip to content

Commit

Permalink
Merge pull request #13 from icerockdev/fixes
Browse files Browse the repository at this point in the history
Release 0.1.1
  • Loading branch information
Alex009 authored Mar 21, 2021
2 parents 8ff0128 + 5f757d3 commit 124b227
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

subprojects {
group = "dev.icerock.tools"
version = "0.2.0-SNAPSHOT"
version = "0.1.1"

apply(plugin = "org.jetbrains.kotlin.jvm")
}
4 changes: 2 additions & 2 deletions install-shaper.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
mkdir -p ~/.shaper && \
cd ~/.shaper && \
curl -L -s "https://github.com/icerockdev/shaper/releases/download/release%2F0.1.0/shaper-cli-0.1.0.zip" > cli.zip && \
curl -L -s "https://github.com/icerockdev/shaper/releases/download/release%2F0.1.1/shaper-cli-0.1.1.zip" > cli.zip && \
unzip -q cli.zip && \
rm cli.zip && \
rm -rf shaper-cli || true && \
mv shaper-cli-0.1.0 shaper-cli && \
mv shaper-cli-0.1.1 shaper-cli && \
echo "repositories:" > config.yaml && \
echo 'To complete setup add into your environments: export PATH=~/.shaper/shaper-cli/bin:$PATH'
echo 'After it you can call shaper by command: shaper-cli -i <input yaml> -o <output dir>'
2 changes: 1 addition & 1 deletion run-cli-sample.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
./gradlew build
cd samples
java -jar ../shaper-cli/build/libs/shaper-cli-0.1.0-SNAPSHOT.jar -i $1.yaml -o $1-out
java -jar ../shaper-cli/build/libs/shaper-cli-0.1.1-SNAPSHOT.jar -i $1.yaml -o $1-out
9 changes: 0 additions & 9 deletions shaper-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ application {
mainClass.set("dev.icerock.tools.shaper.cli.ShaperCliKt")
}

tasks.withType<org.gradle.jvm.tasks.Jar>().configureEach {
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get()
.filter { it.name.endsWith("jar") }
.map { zipTree(it) }
})
}

// export PATH=~/.shaper/shaper-cli/bin:$PATH
tasks.create("install") {
dependsOn(tasks.getByName("installDist"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ class Shaper(private val templateConfig: TemplateConfig) {
if (!exists()) mkdirs()
}

val templateSource = TemplateSourceFactory.create(fileConfig.contentTemplateName)
val contentTemplate = handlebars.compile(templateSource)
FileWriter(file).use { fileWriter ->
contentTemplate.apply(allParams, fileWriter)
if (fileConfig.contentTemplateName.endsWith(".hbs")) {
val templateSource = TemplateSourceFactory.create(fileConfig.contentTemplateName)
val contentTemplate = handlebars.compile(templateSource)
FileWriter(file).use { fileWriter ->
contentTemplate.apply(allParams, fileWriter)
}
} else {
val source = File(fileConfig.contentTemplateName)
source.copyTo(file, overwrite = true)
}
}
val resultWriter = StringWriter()
Expand Down

0 comments on commit 124b227

Please sign in to comment.