Skip to content

Commit 0f056da

Browse files
authored
Merge pull request #38 from SamvelG/patch-1
Fixed an issue to copy source files on windows os
2 parents f2b09a7 + 00f0718 commit 0f056da

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Naneau/Obfuscator/Console/Command/ObfuscateCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,14 @@ private function copyDir($from, $to)
197197
// FIXME implement native copy
198198
$output = array();
199199
$return = 0;
200-
$command = sprintf('cp -rf %s %s', $from, $to);
200+
201+
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
202+
// WINDOWS
203+
$command = sprintf('XCOPY "%s" "%s" /hievry', $from, $to);
204+
} else {
205+
// *NIX
206+
$command = sprintf('cp -rf %s %s', $from, $to);
207+
}
201208

202209
exec($command, $output, $return);
203210

0 commit comments

Comments
 (0)