Repository navigation
feat(website): OS-aware install command and devspace.run/install #436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e153eae
docs: lead installation with the one-command installer
Waishnav 12994b1
feat(website): serve the installers at devspace.run/install
Waishnav bac0ba9
feat(website): show the install command for the visitor's OS
Waishnav 025608e
feat(install): default the installers to the latest release
Waishnav 4ee35ff
fix(website): restore 1.0.x SQLite repair and use toggle buttons
Waishnav 667910c
fix(website): reach every install command without JavaScript
Waishnav File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| --- | ||
| // Toggle buttons for choosing an install method. The script preselects the visitor's OS and keeps every group and | ||
| // every [data-install-command] button (whose data-copy and <code> show the command) on the same choice. | ||
| import { INSTALL_METHODS } from "../content"; | ||
|
|
||
| const [initial] = INSTALL_METHODS; | ||
| --- | ||
|
|
||
| <div class="install__tabs" role="group" aria-label="Install method"> | ||
| {INSTALL_METHODS.map((method) => ( | ||
| <button | ||
| class="install__tab" type="button" data-install-tab={method.id} | ||
| aria-pressed={method.id === initial.id ? "true" : "false"} | ||
| >{method.label}</button> | ||
| ))} | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| </div> | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| <noscript> | ||
| <!-- Without JavaScript the picker cannot switch commands, so list the others here. --> | ||
| <p class="install__noscript"> | ||
| {INSTALL_METHODS.slice(1).map((method) => ( | ||
| <span>{method.label}: <code>{method.command}</code></span> | ||
| ))} | ||
| </p> | ||
| </noscript> | ||
|
|
||
| <style> | ||
| .install__tabs { display: flex; gap: 22px; margin-bottom: 14px; font-size: 13px; } | ||
| .install__tab { | ||
| padding: 0 0 4px; border: 0; border-bottom: 1px solid transparent; background: none; | ||
| font: inherit; color: var(--muted); cursor: pointer; | ||
| } | ||
| .install__tab:hover { color: var(--ink); } | ||
| .install__noscript { display: grid; gap: 6px; margin: 0 0 14px; font-size: 12px; color: var(--muted); } | ||
| .install__noscript code { overflow-wrap: anywhere; } | ||
| .install__tab[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); } | ||
| </style> | ||
|
|
||
| <script> | ||
| import { INSTALL_METHODS } from "../content"; | ||
|
|
||
| type MethodId = (typeof INSTALL_METHODS)[number]["id"]; | ||
|
|
||
| function select(id: MethodId): void { | ||
| const method = INSTALL_METHODS.find((candidate) => candidate.id === id); | ||
|
|
||
| if (!method) return; | ||
|
|
||
| for (const tab of document.querySelectorAll<HTMLElement>("[data-install-tab]")) { | ||
| tab.setAttribute("aria-pressed", tab.dataset.installTab === id ? "true" : "false"); | ||
| } | ||
|
|
||
| for (const command of document.querySelectorAll<HTMLElement>("[data-install-command]")) { | ||
| command.dataset.copy = method.command; | ||
| // A "copied" check belongs to the previous command, which is no longer what the button copies. | ||
| delete command.dataset.copied; | ||
|
|
||
| const code = command.querySelector("code"); | ||
|
|
||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| if (code) code.textContent = method.command; | ||
| } | ||
| } | ||
|
|
||
| document.addEventListener("click", (event) => { | ||
| if (!(event.target instanceof Element)) return; | ||
|
|
||
| const tab = event.target.closest<HTMLElement>("[data-install-tab]"); | ||
| const id = INSTALL_METHODS.find((method) => method.id === tab?.dataset.installTab)?.id; | ||
|
|
||
| if (id) select(id); | ||
| }); | ||
|
|
||
| // The user agent is only a default: every method stays one click away. | ||
| select(/Windows/i.test(navigator.userAgent) ? "windows" : "unix"); | ||
| </script> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Short installer URLs. Cloudflare applies these before serving any asset, so the shell never receives HTML. | ||
| # 302 keeps the target changeable without clients caching it. | ||
| /install https://raw.githubusercontent.com/Waishnav/devspace/main/install/install.sh 302 | ||
| /install.ps1 https://raw.githubusercontent.com/Waishnav/devspace/main/install/install.ps1 302 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: Waishnav/devspace
Length of output: 6085
Document that the published curl pipeline hides fetch failures.
The Unix install command is
curl -fsSL https://devspace.run/install | sh. This command is now the default on the landing page and in the README and quickstart. The pipeline has nopipefailand no separate check of curl's status. When the fetch fails, curl writes no script content,shreads empty input and exits 0, and the pipeline reports success. curl still prints its error text on stderr, so the failure is visible. The false success affects only callers that read the exit status, such as chained commands (&&) or scripts.No safe one-line change is established. A POSIX
shpipeline cannot rely onpipefail, andsh -c "$(curl ...)"loses the status in the same way. If exit status matters, use a two-step form in the published commands:curl -fsSL https://devspace.run/install -o devspace-install.sh && sh devspace-install.sh. This changes the command in content.ts, README.md, and the quickstart, so the team should decide on it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping the one-liner: it is the same pattern OpenCode and Pi publish, and the script cannot act on a partial download because everything is in functions and only the last lines call them, so an empty or truncated fetch runs nothing. curl's -f error still prints on stderr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Waishnav Understood. Keeping the one-liner is an accepted trade-off for the interactive install flow. My concern was only that the pipeline can return success after a fetch failure, not that the failure produces no visible error. The function layout does not change that exit-status behavior.
I will not press for a command change or an added note.
You are interacting with an AI system.