Skip to content

Commit 886ec17

Browse files
committed
feat: add curl alternative install command on config page
Show a secondary curl command below the main openboot install command so users can install without the CLI.
1 parent fcc33a7 commit 886ec17

File tree

1 file changed

+62
-1
lines changed

1 file changed

+62
-1
lines changed

src/lib/components/ConfigDetail.svelte

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@
3333
setTimeout(() => (copied = false), 2000);
3434
}
3535
36+
function getCurlCommand() {
37+
if (config.alias) {
38+
return `curl -fsSL openboot.dev/${config.alias} | bash`;
39+
}
40+
return `curl -fsSL openboot.dev/${configUser.username}/${config.slug} | bash`;
41+
}
42+
43+
let curlCopied = $state(false);
44+
45+
function copyCurlCommand() {
46+
navigator.clipboard.writeText(getCurlCommand());
47+
curlCopied = true;
48+
setTimeout(() => (curlCopied = false), 2000);
49+
}
50+
3651
function getShareUrl() {
3752
if (config.alias) {
3853
return `https://openboot.dev/${config.alias}`;
@@ -217,7 +232,18 @@
217232
{/if}
218233
</button>
219234
</div>
220-
<div class="install-actions">
235+
<div class="curl-alt">
236+
<span class="curl-label">Alternative:</span>
237+
<code>{getCurlCommand()}</code>
238+
<button class="copy copy-curl" onclick={copyCurlCommand}>
239+
{#if curlCopied}
240+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>
241+
{:else}
242+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
243+
{/if}
244+
</button>
245+
</div>
246+
<div class="install-actions">
221247
<button class="share-inline" onclick={openShareModal}>
222248
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/></svg>
223249
Share
@@ -677,6 +703,32 @@
677703
text-align: left;
678704
}
679705
706+
.curl-alt {
707+
display: flex;
708+
align-items: center;
709+
gap: 8px;
710+
margin-bottom: 12px;
711+
padding: 0 4px;
712+
}
713+
714+
.curl-label {
715+
font-size: 0.85rem;
716+
color: var(--text-tertiary);
717+
white-space: nowrap;
718+
}
719+
720+
.curl-alt code {
721+
font-family: 'JetBrains Mono', monospace;
722+
font-size: 0.85rem;
723+
color: var(--text-secondary);
724+
flex: 1;
725+
text-align: left;
726+
}
727+
728+
.copy-curl {
729+
padding: 6px 10px;
730+
}
731+
680732
.copy {
681733
display: flex;
682734
align-items: center;
@@ -1493,6 +1545,15 @@
14931545
text-align: center;
14941546
}
14951547
1548+
.curl-alt {
1549+
flex-direction: column;
1550+
text-align: center;
1551+
}
1552+
1553+
.curl-alt code {
1554+
text-align: center;
1555+
}
1556+
14961557
.copy {
14971558
width: 100%;
14981559
justify-content: center;

0 commit comments

Comments
 (0)