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
10 changes: 9 additions & 1 deletion scripts/on-dev
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ fi

sync() {
ssh "$host" "mkdir -p '$remote'"
rsync -a --no-owner --no-group --delete-after --filter=':- .gitignore' --exclude=.git "$dir/" "$host:$remote/"
local changes
changes=$(rsync -a -i --no-owner --no-group --delete-after --filter=':- .gitignore' --exclude=.git "$dir/" "$host:$remote/") ||
die "rsync to $host failed"
# app/build.rs lists the migrations when database/migrations changes, but rsync keeps a new file's old mtime, so cargo
# would build the old list in: touch the folder when a migration was added or removed (not on every sync, which
# would rebuild the app each time).
if printf '%s\n' "$changes" | grep -qE '^([<>]f\+{9}|\*deleting) +app/database/migrations/'; then
ssh "$host" "touch '$remote/app/database/migrations'"
fi
}

# One remote command, quoted for the remote shell, with the toolchain on PATH and the CPUs pinned.
Expand Down
3 changes: 2 additions & 1 deletion server/frontend/src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export async function request<T>(method: HttpMethod, path: string, body?: unknow
try {
res = await fetch(path, {
method,
headers: body === undefined ? undefined : { 'Content-Type': 'application/json' },
// Accept: the app answers errors as JSON (with their description) only to a request that asks for it
headers: body === undefined ? { Accept: 'application/json' } : { Accept: 'application/json', 'Content-Type': 'application/json' },
credentials: 'same-origin',
body: body === undefined ? undefined : JSON.stringify(body),
})
Expand Down
Loading