diff --git a/.lando.yml b/.lando.yml index d0f5bd2..e88cae9 100644 --- a/.lando.yml +++ b/.lando.yml @@ -34,7 +34,7 @@ services: database: healthcheck: mysql --defaults-extra-file=/app/.lando/mysql.cnf --silent --execute "SHOW DATABASES;" multisite: - type: php:8.2 + type: php:8.3 webroot: multisite events: pre-rebuild: diff --git a/CHANGELOG.md b/CHANGELOG.md index cb15fd1..c22ff5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,8 @@ and this project follows the which is based on the major version of Backdrop CMS with a semantic version system for each contributed module, theme and layout. -## [Unreleased] - 2024-09-06 +## [Unreleased] - 2024-09-07 +## [1.x-1.1.0] - 2024-09-07 ### Added - A new function to check whether or not an executable exists in the system. @@ -115,7 +116,8 @@ filenames) are included in table output. ### Changed - Changed from `b` to `bee` -[Unreleased]: https://github.com/backdrop-contrib/bee/compare/1.x-1.0.2...HEAD +[Unreleased]: https://github.com/backdrop-contrib/bee/compare/1.x-1.1.0...HEAD +[1.x-1.1.0]: https://github.com/backdrop-contrib/bee/compare/1.x-1.0.2...1.x-1.1.0 [1.x-1.0.2]: https://github.com/backdrop-contrib/bee/compare/1.x-1.0.1...1.x-1.0.2 [1.x-1.0.1]: https://github.com/backdrop-contrib/bee/compare/1.x-1.0.0-beta...1.x-1.0.1 [1.x-1.0.0-beta]: https://github.com/backdrop-contrib/bee/compare/v0.0.0...1.x-1.0.0-beta diff --git a/commands/download.bee.inc b/commands/download.bee.inc index 40efd39..accbf45 100644 --- a/commands/download.bee.inc +++ b/commands/download.bee.inc @@ -218,26 +218,13 @@ function download_bee_callback($arguments, $options) { )), 'error'); return; } - else { - // Add an 's' to the end of the type name. - $type_folder = $info['type'] . 's'; - } - // Get the directory to download the project into. - if (!empty($_bee_backdrop_site)) { - $destination = "$_bee_backdrop_root/sites/$_bee_backdrop_site/" . $type_folder; - } - elseif (!empty($_bee_backdrop_root)) { - $destination = "$_bee_backdrop_root/" . $type_folder; - } - else { + $destination = download_get_project_destination($project, $info['type']); + if (empty($destination)) { bee_message(bt("The download destination could not be determined. Re-run the command from within a Backdrop installation, or set the global '--root'/'--site' options."), 'error'); return; } - if (file_exists("$destination/contrib")) { - $destination .= '/contrib'; - } - $destination .= "/$project"; + // Check if the project exists within the site file system. $project_existing_location = download_bee_check_project_exists($project, $info['type']); $project_allow_multisite_copy = download_bee_check_multisite_copy($allow_multisite_copy, $project_existing_location); @@ -267,6 +254,36 @@ function download_bee_callback($arguments, $options) { } } +/** + * A function to format the directory path of a project. + * + * @param string $project + * The name of the project. + * @param string $type + * The project type of the project. + * @return string The location where the project will be downloaded. + */ +function download_get_project_destination($project, $type) { + global $_bee_backdrop_root, $_bee_backdrop_site; + + if (!empty($_bee_backdrop_site)) { + $destination = "$_bee_backdrop_root/sites/$_bee_backdrop_site/" . $type . 's'; + } + elseif (!empty($_bee_backdrop_root)) { + $destination = "$_bee_backdrop_root/" . $type . 's'; + } + else { + return ''; + } + + if (file_exists("$destination/contrib")) { + $destination .= '/contrib'; + } + $destination .= "/$project"; + + return $destination; +} + /** * Command callback: Download Backdrop core. */ diff --git a/commands/update.bee.inc b/commands/update.bee.inc index f6725fc..ab98358 100644 --- a/commands/update.bee.inc +++ b/commands/update.bee.inc @@ -167,9 +167,9 @@ function update_bee_callback($arguments, $options) { return; } foreach ($data as $item) { - $folder = backdrop_get_path($item['project_type'], $item['name']); + $folder = download_get_project_destination($item['name'], $item['project_type']); if (is_dir($folder)) { - bee_delete($folder); + bee_delete($folder); } download_bee_callback(array('projects' => array($item['name']),), []); echo ''; diff --git a/docs/Usage.md b/docs/Usage.md index 4b191ec..2b23393 100644 --- a/docs/Usage.md +++ b/docs/Usage.md @@ -248,6 +248,11 @@ options in a given file. - `bee help status` - Display help for the 'status' command. - `bee help` - Display help for 'bee' itself. +#### `changelog` +*Description:* Display the current CHANGELOG of Bee. +*Examples:* +- `bee changelog` - Output the current CHANGELOG. + ### Core #### `download-core` *Description:* Download Backdrop core. diff --git a/includes/globals.inc b/includes/globals.inc index f707ea3..b1a334f 100644 --- a/includes/globals.inc +++ b/includes/globals.inc @@ -114,11 +114,11 @@ define('BEE_BOOTSTRAP_FULL', 8); // Current version of Bee. // This will normally be based on the next minor release (e.g '1.x-1.1.x-dev') // but will be changed briefly when a release is generated. -define('BEE_VERSION', '1.x-1.1.x-dev'); +define('BEE_VERSION', '1.x-1.2.x-dev'); // Latest release. // This will be updated at each release. -define('BEE_LATEST_RELEASE', '1.x-1.0.2'); +define('BEE_LATEST_RELEASE', '1.x-1.1.0'); /** * Define constants for symbols to be used within Bee.