Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2175 - Fix install command #2182

Merged
merged 2 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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