From dbdb0c86c42e6da1fea410dc2d5113b240742ac5 Mon Sep 17 00:00:00 2001 From: Syntax <2079305+TheUltDev@users.noreply.github.com> Date: Tue, 26 Dec 2023 04:48:08 -0600 Subject: [PATCH] Add ability to specify init command --- src/hooks/useShell.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hooks/useShell.ts b/src/hooks/useShell.ts index 3773448..2f99b7a 100644 --- a/src/hooks/useShell.ts +++ b/src/hooks/useShell.ts @@ -137,7 +137,9 @@ export function useShell(): ShellInstance { // Git repo (clone repo and install) if (location.pathname.startsWith('/~/')) { const repo = location.pathname.replace('/~/', ''); - await input.write(`git clone '${repo}' './' && ni\n`); + const init = new URLSearchParams(window.location.search)?.get('init'); + const cmd = init ? `ni && ${decodeURIComponent(init)}` : 'ni'; + await input.write(`git clone '${repo}' './' && ${cmd}\n`); } // Clear terminal and display