diff --git a/web/src/lib/components/repo/EmptyRepo.stories.svelte b/web/src/lib/components/repo/EmptyRepo.stories.svelte index a4439408..275f4c55 100644 --- a/web/src/lib/components/repo/EmptyRepo.stories.svelte +++ b/web/src/lib/components/repo/EmptyRepo.stories.svelte @@ -26,7 +26,12 @@ - + + + + + + diff --git a/web/src/lib/components/repo/EmptyRepo.svelte b/web/src/lib/components/repo/EmptyRepo.svelte index 5879e878..2a9e309b 100644 --- a/web/src/lib/components/repo/EmptyRepo.svelte +++ b/web/src/lib/components/repo/EmptyRepo.svelte @@ -1,13 +1,20 @@ {#snippet bullet(n: number)} @@ -28,29 +68,67 @@ {/snippet} +{#snippet codeBlock(lines: string[])} +
{lines.join(
+			"\n"
+		)}
+{/snippet} + {#if isOwner} -
-
-

This is an empty repository. To get started:

-

- {@render bullet(1)}First, generate a new - SSH key pair. -

-

- {@render bullet(2)}Then add the public key from the - keys page in your settings. -

-

- {@render bullet(3)}Configure your remote to - {remote} -

-

{@render bullet(4)}Push!

+ {#if keyStatus === "checking"} + + {:else if keyStatus === "has-key"} +
+
+

This is an empty repository.

+
+

…create a new repository on the command line

+ {@render codeBlock([ + `echo "# ${repo.name}" >> README.md`, + "git init", + "git add README.md", + 'git commit -m "initial commit"', + `git branch -M ${repo.defaultBranch}`, + `git remote add origin ${remote}`, + `git push -u origin ${repo.defaultBranch}` + ])} +
+
+

+ …or push an existing repository from the command line +

+ {@render codeBlock([ + `git remote add origin ${remote}`, + `git branch -M ${repo.defaultBranch}`, + `git push -u origin ${repo.defaultBranch}` + ])} +
+
+
+ {:else} +
+
+

This is an empty repository. To get started:

+

+ {@render bullet(1)}First, generate a new + SSH key pair. +

+

+ {@render bullet(2)}Then add the public key from the + keys page in your settings. +

+

+ {@render bullet(3)}Configure your remote to + {remote} +

+

{@render bullet(4)}Push!

+
-
+ {/if} {:else}

This is an empty repository.

{/if}