Skip to content

Commit

Permalink
Add ability to specify init command
Browse files Browse the repository at this point in the history
  • Loading branch information
TheUltDev committed Dec 26, 2023
1 parent 43808b5 commit dbdb0c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hooks/useShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dbdb0c8

Please sign in to comment.