cbmarcum / skeletal

A simple project creation tool that uses packaged templates
Apache License 2.0
17 stars 3 forks source link

FileNotFoundException when setting or adding a configuration on a fresh install #42

Closed cbmarcum closed 1 year ago

cbmarcum commented 1 year ago

No $HOME/.skeletal directory has been created yet so when skeletal tries to create the managed-config.json the error is thrown.

$ skeletal config add simpleRepositories "https://codebuilders.jfrog.io/artifactory/generic/openoffice-templates"
Exception in thread "main" java.io.FileNotFoundException: /home/carl/.skeletal/managed-config.json (No such file or directory)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
    at org.codehaus.groovy.runtime.ResourceGroovyMethods.write(ResourceGroovyMethods.java:855)
    at org.codehaus.groovy.runtime.ResourceGroovyMethods.write(ResourceGroovyMethods.java:836)
    at org.codehaus.groovy.runtime.ResourceGroovyMethods.setText(ResourceGroovyMethods.java:780)
    at org.codehaus.groovy.runtime.dgm$1108.invoke(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:247)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:148)
    at uk.co.cacoethes.lazybones.config.Configuration.storeSettings(Configuration.groovy:131)
    at uk.co.cacoethes.lazybones.config.Configuration$storeSettings$7.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:130)
    at uk.co.cacoethes.lazybones.commands.ConfigCommand.configAdd(ConfigCommand.groovy:181)
cbmarcum commented 1 year ago

need to check for the profile directory and create it if needed.