Skip to content
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

bootstrap: embedded script isn't checked #2

Open
coolaj86 opened this issue Aug 24, 2022 · 0 comments
Open

bootstrap: embedded script isn't checked #2

coolaj86 opened this issue Aug 24, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@coolaj86
Copy link
Member

coolaj86 commented Aug 24, 2022

Obviously it's a dumb idea to embed a script in a heredoc of another script.

We need a different solution for _webi/bootstrap.sh, and it may require a shudder build step... 😬

Thoughts

How about we just make the webi command its own command and installer, just like ssh-adduser?

Or maybe even host it on GitHub releases so it gets its own version?

Maybe just check if the downloaded version is more than 5 minutes old? (bad idea)

Run if WEBI_INSTALL=true is not set. 👍

Implementation thoughts

webi webi and webi update should manually update webi, regardless of version.

if command -v curl > /dev/null 2> /dev/null; then
    if ! curl -fsSL "$my_installer_url" -H "User-Agent: curl $WEBI_UA" \
        -o "$WEBI_BOOT/$my_package-bootstrap.sh"; then
        echo >&2 "error fetching '$my_installer_url'"
        exit 1
    fi
else
    if ! wget -q "$my_installer_url" --user-agent="wget $WEBI_UA" \
        -O "$WEBI_BOOT/$my_package-bootstrap.sh"; then
        echo >&2 "error fetching '$my_installer_url'"
        exit 1
    fi
fi
    webi_download \
        "$WEBI_HOST/packages/${my_cmd}/${my_cmd}.sh" \
        "$HOME/.local/bin/${my_cmd}"
@coolaj86 coolaj86 added the enhancement New feature or request label Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant