Search in sources :

Example 1 with PhoneGapSettings

use of com.github.masahirosuzuka.PhoneGapIntelliJPlugin.settings.PhoneGapSettings in project intellij-plugins by JetBrains.

the class PhoneGapExecutableChecker method check.

public static void check(Project project) {
    PhoneGapSettings instance = PhoneGapSettings.getInstance();
    if (StringUtil.isEmpty(instance.getExecutablePath())) {
        noPhoneGap();
        return;
    }
    String phoneGapExecutablePath = instance.getExecutablePath();
    final GeneralCommandLine generalCommandLine = new GeneralCommandLine(phoneGapExecutablePath, "--version");
    generalCommandLine.setWorkDirectory(project.getBasePath());
    try {
        final OSProcessHandler handler = new OSProcessHandler(generalCommandLine);
        handler.startNotify();
        generalCommandLine.createProcess();
    } catch (Exception e) {
        noPhoneGap();
    }
}
Also used : OSProcessHandler(com.intellij.execution.process.OSProcessHandler) GeneralCommandLine(com.intellij.execution.configurations.GeneralCommandLine) PhoneGapSettings(com.github.masahirosuzuka.PhoneGapIntelliJPlugin.settings.PhoneGapSettings)

Aggregations

PhoneGapSettings (com.github.masahirosuzuka.PhoneGapIntelliJPlugin.settings.PhoneGapSettings)1 GeneralCommandLine (com.intellij.execution.configurations.GeneralCommandLine)1 OSProcessHandler (com.intellij.execution.process.OSProcessHandler)1