import org.argeo.api.cms.CmsLog;
import org.argeo.api.cms.CmsState;
import org.argeo.api.uuid.UuidFactory;
+import org.argeo.cms.util.FsUtils;
import org.argeo.cms.util.OS;
import org.argeo.internal.cms.jshell.osgi.OsgiExecutionControlProvider;
import org.osgi.framework.Bundle;
public void start() throws Exception {
// TODO better define application id, make it configurable
- String applicationID = cmsState.getStatePath("").getFileName().toString();
+ String applicationID;
+ if (Files.exists(cmsState.getStatePath("dev.properties"))) { // in Eclipse
+ applicationID = cmsState.getStatePath("").getFileName().toString();
+ } else {
+ applicationID = cmsState.getStatePath("").getParent().getFileName().toString();
+ }
// TODO centralise state run dir
stateRunDir = OS.getRunDir().resolve(applicationID);
String symbolicName = bundleSnDir.getFileName().toString();
Bundle fromBundle = OsgiExecutionControlProvider.getBundleFromSn(symbolicName);
if (fromBundle == null) {
- log.error("Ignoring bundle " + symbolicName + " because it was not found");
+ log.error("Removing directory for bundle " + symbolicName + " because it was not found in runtime...");
+ FsUtils.delete(bundleSnDir);
return;
}
Long bundleId = fromBundle.getBundleId();
} catch (IOException e) {
log.error("Cannot remove " + jshLinkedDir);
}
+ try {
+ Files.delete(jtermLinkedDir);
+ } catch (IOException e) {
+ log.error("Cannot remove " + jtermLinkedDir);
+ }
}
public void setCmsState(CmsState cmsState) {