|
37 | 37 | import javax.swing.SwingUtilities; |
38 | 38 | import javax.swing.filechooser.FileFilter; |
39 | 39 | import org.netbeans.modules.php.api.executable.InvalidPhpExecutableException; |
| 40 | +import org.netbeans.modules.php.api.util.FileUtils; |
40 | 41 | import org.netbeans.modules.php.api.util.StringUtils; |
41 | 42 | import org.netbeans.modules.php.phpcsfixer.commands.PhpCsFixer; |
42 | 43 | import org.netbeans.modules.php.phpcsfixer.ui.UiUtils; |
@@ -196,7 +197,9 @@ private void browseButtonActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bro |
196 | 197 | .showOpenDialog(); |
197 | 198 | if (phpcsfixer != null) { |
198 | 199 | phpcsfixer = FileUtil.normalizeFile(phpcsfixer); |
199 | | - if (phpcsfixer.getName().equals(PhpCsFixer.NAME_LONG) || phpcsfixer.getName().equals(PhpCsFixer.NAME)) { |
| 200 | + if (phpcsfixer.getName().equals(PhpCsFixer.NAME_LONG) |
| 201 | + || phpcsfixer.getName().equals(PhpCsFixer.NAME) |
| 202 | + || phpcsfixer.getName().equals(PhpCsFixer.NAME + FileUtils.getScriptExtension(true))) { |
200 | 203 | setPath(phpcsfixer.getAbsolutePath()); |
201 | 204 | } else { |
202 | 205 | setPath(""); // NOI18N |
@@ -319,7 +322,9 @@ void load() { |
319 | 322 | void store() { |
320 | 323 | PhpCsFixerOptions options = getOptions(); |
321 | 324 | String path = getPath(); |
322 | | - if (path.endsWith(PhpCsFixer.NAME) || path.endsWith(PhpCsFixer.NAME_LONG)) { |
| 325 | + if (path.endsWith(PhpCsFixer.NAME) |
| 326 | + || path.endsWith(PhpCsFixer.NAME_LONG) |
| 327 | + || path.endsWith(PhpCsFixer.NAME + FileUtils.getScriptExtension(true))) { |
323 | 328 | options.setPhpCsFixerPath(getPath()); |
324 | 329 | } else { |
325 | 330 | options.setPhpCsFixerPath(""); // NOI18N |
|
0 commit comments