From b9a6ec2c330ced5d6576abd2e6ab4c166cef01b3 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 1 Apr 2020 22:53:24 +0200 Subject: [PATCH] fix: added cli/launcher.bat and add changelog #1440 --- CHANGELOG.md | 7 +++++++ src/Builder/Project/Cli.php | 11 +++++++++-- templates/project/cli/launcher.bat | 4 ++++ templates/project/modules/launcher.bat | 4 ++-- 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 templates/project/cli/launcher.bat diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..e0242e759 --- /dev/null +++ b/CHANGELOG.md @@ -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) diff --git a/src/Builder/Project/Cli.php b/src/Builder/Project/Cli.php index ed7870e5f..100edc8d0 100644 --- a/src/Builder/Project/Cli.php +++ b/src/Builder/Project/Cli.php @@ -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); } diff --git a/templates/project/cli/launcher.bat b/templates/project/cli/launcher.bat new file mode 100644 index 000000000..43f3f14b1 --- /dev/null +++ b/templates/project/cli/launcher.bat @@ -0,0 +1,4 @@ +@echo off + +set CURRENT_PATH=%~dp0 +php %CURRENT_PATH%run diff --git a/templates/project/modules/launcher.bat b/templates/project/modules/launcher.bat index 28c759086..667f65e97 100644 --- a/templates/project/modules/launcher.bat +++ b/templates/project/modules/launcher.bat @@ -1,4 +1,4 @@ @echo off -set PATH=%~dp0 -php %PATH%launcher +set CURRENT_PATH=%~dp0 +php %CURRENT_PATH%launcher