Enhance getInstallCommand to support Alpine variant in InstallCommand component (#281)

This commit is contained in:
Bram Suurd 2024-11-16 12:13:56 +01:00 committed by GitHub
parent 36b9452ed7
commit ea559e7018
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,8 +4,8 @@ import { basePath } from "@/config/siteConfig";
import { Script } from "@/lib/types";
import { getDisplayValueFromType } from "../ScriptInfoBlocks";
const getInstallCommand = (scriptPath?: string) => {
return `bash -c "$(wget -qLO - https://github.com/community-scripts/${basePath}/raw/main/${scriptPath})"`;
const getInstallCommand = (scriptPath?: string, isAlpine = false) => {
return `bash -c "$(wget -q${isAlpine ? "" : "L"}O - https://github.com/community-scripts/${basePath}/raw/main/${scriptPath})"`;
};
export default function InstallCommand({ item }: { item: Script }) {
@ -67,7 +67,7 @@ export default function InstallCommand({ item }: { item: Script }) {
<TabsContent value="alpine">
{renderInstructions(true)}
<CodeCopyButton>
{getInstallCommand(alpineScript.script)}
{getInstallCommand(alpineScript.script, true)}
</CodeCopyButton>
</TabsContent>
</Tabs>