1060NetKernel / gradle-plugin

Gradle Plugin to provide build, deploy, module templating functionality and more
3 stars 4 forks source link

Issue with INSTALLPATH quoting in ThawConfigureTask.groovy #16

Closed windhamg closed 7 years ago

windhamg commented 8 years ago

The first time you run the thawXXX task, the INSTALLPATH variable in bin/netkernel.sh is updated with the value of the location parameter. However, in doing so, the original single quotes around the value are replaced with double quotes. If you subsequently "re-freeze" a thawed instance and attempt to thaw it, the INSTALLPATH substitution fails because the single quotes are no longer there.

The following trivial patch fixes the issue. If you would like a pull request, just let me know.

diff --git a/src/main/groovy/org/netkernel/gradle/plugin/tasks/ThawConfigureTask.groovy b/src/main/groovy/org/netkernel/gradle/plugin/tasks/ThawConfigureTask.groovy
index fe561f5..f2c7f77 100644
--- a/src/main/groovy/org/netkernel/gradle/plugin/tasks/ThawConfigureTask.groovy
+++ b/src/main/groovy/org/netkernel/gradle/plugin/tasks/ThawConfigureTask.groovy
@@ -35,7 +35,7 @@ class ThawConfigureTask extends DefaultTask {
                def i=line2.indexOf('\'');
                if (i>0)
                {   def installPath=line2.substring(i+1);
                    [-line2="""INSTALLPATH="${thawDirInner}"-]{+line2="""INSTALLPATH='${thawDirInner}'+} """;
                }
            }
            sb2.append(line2);