String response = ShellUtils.readLine(session, "Do you wish to proceed (yes/no): ", false);
return response != null && (response.toLowerCase().equals("yes") || response.toLowerCase().equals("y"));
}
public void installBundles() throws BundleException {
BundleUtils bundleUtils = new BundleUtils(bundleContext);
Bundle bundleFabricCommands = bundleUtils.findBundle("io.fabric8.fabric-commands");
if (bundleFabricCommands == null) {
bundleFabricCommands = bundleUtils.installBundle("mvn:io.fabric8/fabric-commands/" + FabricConstants.FABRIC_VERSION);
}
bundleFabricCommands.start();
Bundle bundleFabricAgent = bundleUtils.findBundle("io.fabric8.fabric-agent");
if (nonManaged && bundleFabricAgent == null) {
//do nothing
} else if (nonManaged && bundleFabricAgent != null) {
bundleFabricAgent.stop();
} else if (bundleFabricAgent == null) {
bundleFabricAgent = bundleUtils.installBundle("mvn:io.fabric8/fabric-agent/" + FabricConstants.FABRIC_VERSION);
bundleFabricAgent.start();
} else {
bundleFabricAgent.start();
}
}