Use static assets instead of fetching from github (#156)

This commit is contained in:
Håvard Gjøby Thom
2024-11-09 20:06:54 +01:00
committed by GitHub
parent 2af11d145f
commit d199762427
18 changed files with 136 additions and 107 deletions

View File

@@ -6,7 +6,7 @@ import { getDisplayValueFromType } from "../ScriptInfoBlocks";
const getInstallCommand = (scriptPath?: string) => {
return `bash -c "$(wget -qLO - https://github.com/community-scripts/${basePath}/raw/main/${scriptPath})"`;
}
};
export default function InstallCommand({ item }: { item: Script }) {
const alpineScript = item.install_methods.find(
@@ -14,7 +14,7 @@ export default function InstallCommand({ item }: { item: Script }) {
);
const defaultScript = item.install_methods.find(
(method) => method.type === "default"
(method) => method.type === "default",
);
const renderInstructions = (isAlpine = false) => (
@@ -60,7 +60,9 @@ export default function InstallCommand({ item }: { item: Script }) {
</TabsList>
<TabsContent value="default">
{renderInstructions()}
<CodeCopyButton>{getInstallCommand(defaultScript?.script)}</CodeCopyButton>
<CodeCopyButton>
{getInstallCommand(defaultScript?.script)}
</CodeCopyButton>
</TabsContent>
<TabsContent value="alpine">
{renderInstructions(true)}