Compare commits
No commits in common. "68434ca75fb27a0cff03542e7e205082572db215" and "2519f8b86ddd4bb7ebda9776a02bb7cebb19e5d1" have entirely different histories.
68434ca75f
...
2519f8b86d
|
@ -1,23 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# This hook checks if the commit message ends with an issue number, and if not,
|
|
||||||
# tries to derive that number from the branch name
|
|
||||||
|
|
||||||
branch=`git rev-parse --abbrev-ref HEAD`
|
|
||||||
|
|
||||||
# This check doesn't need to run when commiting to develop/master
|
|
||||||
[[ "$branch" =~ ^master|develop$ ]] && exit 0
|
|
||||||
|
|
||||||
issue_num=`echo "$branch" | grep -Po '^[0-9]+(?=-)'`
|
|
||||||
|
|
||||||
# Check if issue number is already present
|
|
||||||
if ! grep -q '([0-9]\+)$' "$1"; then
|
|
||||||
# Error out if we can't derive issue number
|
|
||||||
[[ -z "$issue_num" ]] && {
|
|
||||||
>&2 echo "Couldn't derive issue number from branch. Please add one manually.";
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Append issue number, and remove all comments
|
|
||||||
echo "[#$issue_num]" "$(cat "$1")" > "$1"
|
|
||||||
fi
|
|
|
@ -1,13 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# This hook lints the code, and if we're on develop or master, also forces the tests to pass.
|
|
||||||
|
|
||||||
branch=`git rev-parse --abbrev-ref HEAD`
|
|
||||||
|
|
||||||
# TODO should we add release branches here as well?
|
|
||||||
if [[ "$branch" =~ ^master|develop$ ]]; then
|
|
||||||
make test > /dev/null 2>&1 || {
|
|
||||||
>&2 echo "Tests failed. check 'make test' for more info.";
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
fi
|
|
|
@ -1,5 +0,0 @@
|
||||||
# Ivago
|
|
||||||
|
|
||||||
This part of the API is a wrapper around the Ivago website (Ivago being the
|
|
||||||
company that collects the trash in my city). Their city isn't exactly RESTful,
|
|
||||||
so this endpoint simply wraps it in a RESTful wrapper.
|
|
|
@ -13,8 +13,8 @@ pub fn routes() -> Vec<rocket::Route> {
|
||||||
// URL: https://www.ivago.be/nl/particulier/autocomplete/garbage/streets?q=Lange
|
// URL: https://www.ivago.be/nl/particulier/autocomplete/garbage/streets?q=Lange
|
||||||
// TODO make this async
|
// TODO make this async
|
||||||
// TODO change this so it can return errors instead of empty json
|
// TODO change this so it can return errors instead of empty json
|
||||||
#[get("/search?<street>")]
|
#[get("/search?<street>", format="json")]
|
||||||
pub fn search_streets_json(street: String) -> Json<Vec<controller::Street>> {
|
pub fn route_search_streets(street: String) -> Json<Vec<controller::Street>> {
|
||||||
match controller::search_streets(&street) {
|
match controller::search_streets(&street) {
|
||||||
Ok(streets) => Json(streets),
|
Ok(streets) => Json(streets),
|
||||||
Err(err) => Json(Vec::new()),
|
Err(err) => Json(Vec::new()),
|
||||||
|
|
Loading…
Reference in New Issue