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

fix: added cli/launcher.bat and add changelog #1440 #1441

Merged
merged 1 commit into from
Apr 2, 2020
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# [4.0.2](https://github.com/phalcon/cphalcon/releases/tag/v4.0.2) (2020-xx-xx)
## Added
- Added launcher.bat to run cli with Windows and used DIRECTORY_SEPARATOR to find the file. [#1440](https://github.com/phalcon/phalcon-devtools/issues/1440) [@jenovateurs](https://github.com/jenovateurs)
## Changed

## Fixed
- Fixed Scaffold templates errors and phpstan errors. [#1429](https://github.com/phalcon/phalcon-devtools/issues/1429) [@jenovateurs](https://github.com/jenovateurs)
11 changes: 9 additions & 2 deletions src/Builder/Project/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,20 @@ public function build(): bool
*/
private function createLauncher()
{
$getFile = $this->options->get('templatePath') . '/project/cli/launcher';
$getFile = $this->options->get('templatePath') .
DIRECTORY_SEPARATOR . 'project' .
DIRECTORY_SEPARATOR . 'cli' .
DIRECTORY_SEPARATOR . 'launcher';

$putFile = $this->options->get('projectPath') . 'run';
$this->generateFile($getFile, $putFile);
chmod($putFile, 0755);

if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$getFile = $this->options->get('templatePath') . '/project/cli/launcher.bat';
$getFile = $this->options->get('templatePath') .
DIRECTORY_SEPARATOR . 'project' .
DIRECTORY_SEPARATOR . 'cli' .
DIRECTORY_SEPARATOR . 'launcher.bat';
$putFile = $this->options->get('projectPath') . 'run.bat';
$this->generateFile($getFile, $putFile);
}
Expand Down
4 changes: 4 additions & 0 deletions templates/project/cli/launcher.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off

set CURRENT_PATH=%~dp0
php %CURRENT_PATH%run
4 changes: 2 additions & 2 deletions templates/project/modules/launcher.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@echo off

set PATH=%~dp0
php %PATH%launcher
set CURRENT_PATH=%~dp0
php %CURRENT_PATH%launcher