Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

18 linesCodeBlameRaw
1import { linkPathOf, routeFor } from "@/lib/links";
2
3/**
4 * Where a link that opens the app goes. `g1t://` links name a site path,
5 * as on the desktop; the app shows the ones it has screens for and opens
6 * the rest on the site (app/open.tsx). Android App Links and iOS
7 * Universal Links for https://g1t.sh come through here too once the site
8 * publishes assetlinks.json and apple-app-site-association.
9 */
10export function redirectSystemPath({ path }: { path: string; initial: boolean }): string {
11 try {
12 const sitePath = linkPathOf(path) ?? path;
13 const route = routeFor(sitePath);
14 return route ?? `/open?path=${encodeURIComponent(sitePath)}`;
15 } catch {
16 return "/";
17 }
18}