Closed paul-hammant closed 8 months ago
@paul-hammant How about turning it into an install-type script that can be fetched/executed?
Something like:
#!/bin/sh
version=$(curl -Ls -o /dev/null -w "%{url_effective}" https://github.com/rife2/bld/releases/latest)
version=${version##*/}
curl -L https://github.com/rife2/bld/releases/download/$version/bld-$version.jar -o ./deleteme.jar
java -jar ./deleteme.jar create
rm -f ./deleteme.jar
Oneliners are the high bar, dude :)
If y'all moved site hosting off GitHub-Pages onto netlify you can program 302 style redirects - https://docs.netlify.com/routing/redirects - cos curl can follow those but not html-meta or JS redirects unfortunately. It's a shame that curl doesn't make its own redirect mime-type that'd become a defacto standard.
.. that'd allow you to get back to the oneliner. And Netlify has a free provision too :)
@paul-hammant You're overthinking it. ;-)
The oneliner for executing the script would be so simple:
curl -s https://raw.githubusercontent.com/rife2/bld/scripts/create.sh | bash
Yeah, you're right
@gbevin Thoughts?
Any additional way to install it works for me
I would host this on the main website though:
curl -s https://rife2.com/bld/create.sh | bash
I would host this on the main website though:
curl -s https://rife2.com/bld/create.sh | bash
I'll add it to this repo, and you can put it on the website.
BTW, you may have to change the mine-type for shell scripts to text/plain
.
I'm rewriting the script :-)
Well not rewriting, making some improvements
Well not rewriting, making some improvements
If you're adding a bunch of ifs
, etc. make sure they are sh
compatible, not bash. Use shellcheck.
Looks good, if you don't mind the echo noise pollution. :->
I think it's important that people know what is happening, just throwing them into the create prompt feels very jarring
curl -Ls https://rife2.com/bld/create.sh | bash
curl -Ls https://rife2.com/bld/upgrade.sh | bash
I made NGINX do a redirect to the raw GitHub file so that we can still easily tweak it.
This brings out that stdin issue though, because when I run the scripts locally I get the interactive prompt, when I pipe to bash, I don't.
I think it's important that people know what is happening, just throwing them into the create prompt feels very jarring
Yeah, it's fine. I didn't add the jar
to the temp dir, because I thought that if people canceled the creation, they would still have the jar
in the current directory. But in retrospect that would be confusing.
One issue that might arise, is that if they cancel, the temp jar will not be deleted. That might cause problem am issue with curl the next time around. It'd be best to use a redirection:
curl -L -s "https://github.com/rife2/bld/releases/download/$version/bld-$version.jar" > "$filepath"
Good point, fixed
This does it
/bin/bash -c "$(curl -Ls https://rife2.com/bld/create.sh)"
/bin/bash -c "$(curl -Ls https://rife2.com/bld/upgrade.sh)"
Or even better:
/bin/bash -c "$(curl -fsSL https://rife2.com/bld/create.sh)"
/bin/bash -c "$(curl -fsSL https://rife2.com/bld/upgrade.sh)"
I think we can add that to the wiki now, agreed?
Or even better:
/bin/bash -c "$(curl -fsSL https://rife2.com/bld/create.sh)"
/bin/bash -c "$(curl -fsSL https://rife2.com/bld/upgrade.sh)"
Not for me:
❯ bash -c "$(curl -fsSL https://rife2.com/bld/create.sh)"
mktemp: too few X's in template ‘bld-1.8.0.jar’
Downloading bld v1.8.0...
bash: line 10: : No such file or directory
Welcome to bld v1.8.0.
Error: Unable to access jarfile
Oh man exs have always been a pain! ;-)
Try now
Oh man exs have always been a pain! ;-)
Not quite sure your ex-girlfriend would agree, since she's now your wife. ;-)
Ah, no, she's my wife AND my girlfriend :-)
Try now
Yup, I guess we found the same StackExchange answer.
Actually I read the mktemp
man page on Linux and macOS and tried it out on both machines :-)
Ah, no, she's my wife AND my girlfriend :-)
Sure, try introducing her as your girlfriend, see how well that goes. :-D
Oh I wrote AND, not OR :-D
Oh I wrote AND, not OR :-D
It'll be cute the first time…
Or even better:
/bin/bash -c "$(curl -fsSL https://rife2.com/bld/create.sh)"
/bin/bash -c "$(curl -fsSL https://rife2.com/bld/upgrade.sh)"
Let's not include /bin/
in the documentation as bash
could be in /usr/bin/
, /usr/local/bin/
, etc.
Good point
Added
E.g.
Maybe that spits out: run './bld updates' to update bld itself in case you bootstrapped an older version by accident