Skip to content

Commit 38e6c01

Browse files
committed
Merge pull request #167 from davidverholen/master
resolves #166
2 parents 34a51d2 + 3a684a5 commit 38e6c01

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/MagentoHackathon/Composer/Magento/GitIgnore.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public function __construct($fileLocation)
4040
*/
4141
public function addEntry($file)
4242
{
43+
$file = $this->normalizeEntry($file);
4344
if (!isset($this->lines[$file])) {
4445
$this->lines[$file] = $file;
4546
}
@@ -61,6 +62,7 @@ public function addMultipleEntries(array $files)
6162
*/
6263
public function removeEntry($file)
6364
{
65+
$file = $this->normalizeEntry($file);
6466
if (isset($this->lines[$file])) {
6567
unset($this->lines[$file]);
6668
$this->hasChanges = true;
@@ -94,4 +96,16 @@ public function write()
9496
file_put_contents($this->gitIgnoreLocation, implode("\n", array_flip($this->lines)));
9597
}
9698
}
97-
}
99+
100+
/**
101+
* normalizeEntry
102+
*
103+
* @param string $entry
104+
*
105+
* @return string
106+
*/
107+
public function normalizeEntry($entry)
108+
{
109+
return str_replace('\\', '/', $entry);
110+
}
111+
}

0 commit comments

Comments
 (0)