Skip to content

Commit

Permalink
Merge pull request #2182 from zephir-lang/#2175-fix-install-command
Browse files Browse the repository at this point in the history
#2175 - Fix install command
  • Loading branch information
Jeckerson authored Mar 31, 2021
2 parents c800ac0 + 45498d1 commit 54830d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org).
## [Unreleased]
### Fixed
- Fixed not used arginfo for interface static method without parameters (PHP `>= 8.0` only) [#2178](https://github.com/zephir-lang/zephir/pull/2178)
- Fixed `zephir install` command [#2175](https://github.com/zephir-lang/zephir/issues/2175)

## [0.13.0] - 2021-03-25
### Added
Expand Down
25 changes: 13 additions & 12 deletions Library/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,19 @@ public function compile(bool $development = false): void
$extensionName = $namespace;
}

$currentDir = getcwd();
if (file_exists("{$currentDir}/compile.log")) {
unlink("{$currentDir}/compile.log");
}

if (file_exists("{$currentDir}/compile-errors.log")) {
unlink("{$currentDir}/compile-errors.log");
}

if (file_exists("{$currentDir}/ext/modules/{$namespace}.so")) {
unlink("{$currentDir}/ext/modules/{$namespace}.so");
}

if (is_windows()) {
// TODO(klay): Make this better. Looks like it is non standard Env. Var
exec('cd ext && %PHP_DEVPACK%\\phpize --clean', $output, $exit);
Expand Down Expand Up @@ -995,18 +1008,6 @@ public function install(bool $development = false): void
throw new NotImplementedException('Installation is not implemented for Windows yet. Aborting.');
}

if (file_exists("{$currentDir}/compile.log")) {
unlink("{$currentDir}/compile.log");
}

if (file_exists("{$currentDir}/compile-errors.log")) {
unlink("{$currentDir}/compile-errors.log");
}

if (file_exists("{$currentDir}/ext/modules/{$namespace}.so")) {
unlink("{$currentDir}/ext/modules/{$namespace}.so");
}

$this->logger->info('Installing...');
$gccFlags = $this->getGccFlags($development);

Expand Down

0 comments on commit 54830d3

Please sign in to comment.