From 5ab41f2033b2a77968135307c5465c4502651d1b Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 12 Dec 2023 17:58:49 +0100 Subject: [PATCH 1/2] Convert string interpolation to a 'sprintf()' call --- packages/realtime-compiler/src/Http/DashboardController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/realtime-compiler/src/Http/DashboardController.php b/packages/realtime-compiler/src/Http/DashboardController.php index 08e15fb85a8..56fc7e56b82 100644 --- a/packages/realtime-compiler/src/Http/DashboardController.php +++ b/packages/realtime-compiler/src/Http/DashboardController.php @@ -357,7 +357,7 @@ protected function createPage(): void $this->abort($exception->getCode(), $exception->getMessage()); } - $this->writeToConsole("Created file '$path'", 'dashboard@createPage'); + $this->writeToConsole(sprintf("Created file '%s'", $path), 'dashboard@createPage'); $this->flash('justCreatedPage', RouteKey::fromPage($pageClass, $pageClass::pathToIdentifier($path))->get()); $this->setJsonResponse(201, "Created file '$path'!"); From b054d7db0d0f6850d5cb498b073772b7347ee38f Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 12 Dec 2023 18:00:55 +0100 Subject: [PATCH 2/2] Shorten path printed to console when using dashboard to create a page --- RELEASE_NOTES.md | 2 +- packages/realtime-compiler/src/Http/DashboardController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 5e075dcdba1..2bd9f25e0cb 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -13,7 +13,7 @@ This serves two purposes: - for new features. ### Changed -- for changes in existing functionality. +- Shortened the path printed to console when using dashboard to create a page in https://github.com/hydephp/develop/pull/1492 ### Deprecated - for soon-to-be removed features. diff --git a/packages/realtime-compiler/src/Http/DashboardController.php b/packages/realtime-compiler/src/Http/DashboardController.php index 56fc7e56b82..7e474a9ec83 100644 --- a/packages/realtime-compiler/src/Http/DashboardController.php +++ b/packages/realtime-compiler/src/Http/DashboardController.php @@ -357,7 +357,7 @@ protected function createPage(): void $this->abort($exception->getCode(), $exception->getMessage()); } - $this->writeToConsole(sprintf("Created file '%s'", $path), 'dashboard@createPage'); + $this->writeToConsole(sprintf("Created file '%s'", Hyde::pathToRelative($path)), 'dashboard@createPage'); $this->flash('justCreatedPage', RouteKey::fromPage($pageClass, $pageClass::pathToIdentifier($path))->get()); $this->setJsonResponse(201, "Created file '$path'!");