Skip to content

Commit 8f0b140

Browse files
committed
Support for php-cs-fixer.bat #37
1 parent 39fe553 commit 8f0b140

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/org/netbeans/modules/php/phpcsfixer/options/PhpCsFixerPanel.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import javax.swing.SwingUtilities;
3838
import javax.swing.filechooser.FileFilter;
3939
import org.netbeans.modules.php.api.executable.InvalidPhpExecutableException;
40+
import org.netbeans.modules.php.api.util.FileUtils;
4041
import org.netbeans.modules.php.api.util.StringUtils;
4142
import org.netbeans.modules.php.phpcsfixer.commands.PhpCsFixer;
4243
import org.netbeans.modules.php.phpcsfixer.ui.UiUtils;
@@ -196,7 +197,9 @@ private void browseButtonActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bro
196197
.showOpenDialog();
197198
if (phpcsfixer != null) {
198199
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))) {
200203
setPath(phpcsfixer.getAbsolutePath());
201204
} else {
202205
setPath(""); // NOI18N
@@ -319,7 +322,9 @@ void load() {
319322
void store() {
320323
PhpCsFixerOptions options = getOptions();
321324
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))) {
323328
options.setPhpCsFixerPath(getPath());
324329
} else {
325330
options.setPhpCsFixerPath(""); // NOI18N

0 commit comments

Comments
 (0)