Skip to content
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
6 changes: 6 additions & 0 deletions .github/actions/deploy/fill-in-data.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#! /bin/bash

version="$1"
major="$2"
minor="$3"
patch="$4"

echo "Updating info.xml"
cat .github/actions/deploy/appinfo/info.xml.dist | sed "s/%%VERSION%%/$version/g" > appinfo/info.xml

echo "Updating package.json"
sed "s/\"version\": \\?\"[^\"]*\"/\"version\": \"$version\"/g" -i package.json

echo "Updating version in main controller"
sed "/VERSION_TAG/s@[[].*[]]@[$major, $minor, $patch]@" -i lib/Controller/MainController.php
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
[#416](https://github.com/nextcloud/cookbook/pull/416/) @seyfeb
- Asking user for confirmation when leaving recipe-editor form with changes
[#464](https://github.com/nextcloud/cookbook/pull/464/) @seyfeb
- Exporting the maximal API endpoint version
[#487](https://github.com/nextcloud/cookbook/pull/487) @christianlupus

### Changed
- Switch of project ownership to nextcloud organization in GitHub
Expand Down
1 change: 1 addition & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
return [
'routes' => [
['name' => 'main#getApiVersion', 'url' => '/api/version', 'verb' => 'GET'],
['name' => 'main#index', 'url' => '/', 'verb' => 'GET'],
['name' => 'main#home', 'url' => '/home', 'verb' => 'GET'],
['name' => 'main#keywords', 'url' => '/keywords', 'verb' => 'GET'],
Expand Down
16 changes: 16 additions & 0 deletions lib/Controller/MainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ public function index(): TemplateResponse {

return new TemplateResponse($this->appName, 'index', $view_data); // templates/index.php
}

/**
* @NoAdminRequired
* @NoCSRFRequired
* @return DataResponse
*/
public function getApiVersion(): DataResponse {
$response = [
'cookbook_version' => [0,7,7], /* VERSION_TAG do not change this line manually */
'api_version' => [
'major' => 0,
'minor' => 1
]
];
return new DataResponse($response, 200, ['Content-Type' => 'application/json']);
}

/**
* @NoAdminRequired
Expand Down