webinstall / webi-installers Goto Github PK
View Code? Open in Web Editor NEWPrimary and community-submitted packages for webinstall.dev
Home Page: https://webinstall.dev
License: Mozilla Public License 2.0
Primary and community-submitted packages for webinstall.dev
Home Page: https://webinstall.dev
License: Mozilla Public License 2.0
Wanted: _common/brew.js
The goal IS NOT to implement dependency management like Brew.
webinstall.dev is intended to be lightweight and simple.
However, brew does have an API for packages and there are some packages that officially release to brew, such as MariaDB.
As seen on https://webinstall.dev/prettier/ the Prettier cheat sheet, the --ignore
option is incorrect.
--ignore
is not the correct argument to pass names of directories to ignoreAlso, the format of .prettierignore
is incorrect.
./
, they should be left bare./dist
should be dist/
Needs to be edited here: https://github.com/webinstall/packages/blob/master/prettier/README.md
@ryanburnette You've been better about this than me, but since we've at the point of publicizing, I'm of the opinion that all changes should go through a PR process and we don't commit without peer review.
I've enforced master branch protection here:
https://github.com/webinstall/packages/settings/branches
High Sierra doesn't require spctl
permission grants for Gate Keeper, yet spctl
still reports everything as rejected.
Might need to check for 10.13
in some sort of system string.
Should probabyl use
xattr -r -d com.apple.quarantine /path/to/MyApp.app
However, there's a tricky bit here in determining if it's Linux xattr
or not, which does not support -r
.
On linux
the x86 build of pathman
is being downloaded in place of the amd64 build.
You'll get this message:
pathman-bootstrap.sh: line 214:
/home/me/.local/bin/pathman: cannot execute binary file: Exec format error
Remove the incorrect build of pathman
:
rm -rf ~/.local/*bin*/pathman
Re-install webi + (for example) node:
curl -fsS https://webinstall.dev/node | bash
This has been hotfix
ed in production as c6ff689 and will be merged into master
after review.
cc/ @ryanburnette
$ curl https://webinstall.dev/ripgrep | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3573 100 3573 0 0 8390 0 --:--:-- --:--:-- --:--:-- 8407
Found ripgrep v12.0.1
'ripgrep' (project) is an alias for 'rg' (command)
Found rg v12.0.1
WARN: possible conflict with ripgrep v12.0.1 at /usr/local/bin/rg
Downloading ripgrep v12.0.1 from https://github.com/BurntSushi/ripgrep/releases/download/12.0.1/ripgrep-12.0.1-x86_64-apple-darwin.tar.gz
Installing ripgrep v12.0.1 as /Users/ryan/.local/bin/rg
mv: rename ./ripgrep-12.0.1-x86_64-apple-darwin/rg to /Users/ryan/.local/bin/: No such file or directory
Translate the Github release data into a format that is pretty darn close to what we need for webinstall.dev, accepting that it may need to be wrapped in some cases so that manual manipulation can be applied afterwards.
(using false
, ""
, etc for fields that don't apply).
https://api.github.com/repos/:user/:repo/releases
From
{
"url": "https://api.github.com/repos/BurntSushi/ripgrep/releases/assets/19122945",
"id": 19122945,
"node_id": "MDEyOlJlbGVhc2VBc3NldDE5MTIyOTQ1",
"name": "ripgrep-12.0.1-arm-unknown-linux-gnueabihf.tar.gz",
"label": "",
"uploader": {
"login": "github-actions[bot]",
"id": 41898282,
"node_id": "MDM6Qm90NDE4OTgyODI=",
"avatar_url": "https://avatars2.githubusercontent.com/in/15368?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"html_url": "https://github.com/apps/github-actions",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"type": "Bot",
"site_admin": false
},
"content_type": "application/octet-stream",
"state": "uploaded",
"size": 1853213,
"download_count": 182,
"created_at": "2020-03-29T23:07:18Z",
"updated_at": "2020-03-29T23:07:19Z",
"browser_download_url": "https://github.com/BurntSushi/ripgrep/releases/download/12.0.1/ripgrep-12.0.1-arm-unknown-linux-gnueabihf.tar.gz"
}
To
{
version: 'v1.0.0',
date: '2020-04-01',
lts: true, // false,
channel: 'stable', // 'beta', 'unstable'... ?
os: 'macos', // linux, windows
arch: 'amd64',
ext: 'tar.gz',
//sha1: '', // ?
download: 'https://.../<package>.tar.gz'
}
'use strict';
// this may need customizations between packages
var map = {
// OSes
'macos': /\b(mac|darwin|iPhone|iOS|iPad)/i,
linux: /\b(linux)/i,
win: /\b(win|microsoft|msft)/i,
sunos: /\b(sun)/i,
aix: /\b(aix)/i,
// CPU architectures
x64: /\b(amd64|x64|_64|-64)/i,
x86: /\b(x86)/i,
ppc64le: /\b(ppc64le)/i,
ppc64: /\b(ppc64)\b/i,
arm64: /\b(arm64)/i,
armv7l: /\b(armv?7l?/i,
armv6l: /\b(armv?6l?/i,
s390x: /\b(s390x)/i,
// file extensions
pkg: /\.pkg$/i,
exe: /\.exe$/i,
msi: /\.msi$/i,
'7z': /\.7;$/i,
zip: /\.zip$/i,
tar: /\.tar\./i
};
function getAllReleases(request, owner, repo) {
return request({
url: 'https://api.github.com/repos/' + owner + '/' + repo + '/releases',
json: true
}).then(function (resp) {
var rels = resp.body;
// transform here
return all;
});
}
module.exports = getAllReleases;
if (module === require.main) {
getAllReleases(require('@root/request')).then(function (all) {
console.log(JSON.stringify(all));
//console.log(JSON.stringify(all, null, 2));
});
}
We do need to update the bootstrap bat file to include the relevant variables and pass them in, but in the meantime it would still be useful to have some templates that successfully unpack various software from windows zip files and put the right things in the right places.
This is the node example:
https://github.com/webinstall/packages/blob/master/node/node.bat
:
@echo off
setlocal
pushd "%userprofile%" || goto :error
pushd "%userprofile%\.local\opt" || goto :error
powershell $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest https://nodejs.org/dist/v12.16.2/node-v12.16.2-win-x64.zip -OutFile node-v12.16.2-win-x64.zip || goto :error
rem BSD-tar handles ZIP in Windows 10. Imagine that.
tar xf node-v12.16.2-win-x64.zip || goto :error
rename node-v12.16.2-win-x64 node-v12.16.2 || goto :error
del node-v12.16.2-win-x64.zip || goto :error
popd || goto :error
rem make npm not act stupid about which node to use... ugh (this should be the default)
.\.local\opt\node-v12.16.2\npm.cmd" --scripts-prepend-node-path=true config set scripts-prepend-node-path true || goto :error
pathman add .local\opt\node-v12.16.2 || goto :error
popd || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%
Since gitea uses Github releases (and will use the nearly identical Gitea releases in the future), this is just a copy/paste/test job.
Can I get a caddy installer?
We want to add this as a cross-platform drop-in replacement for ls
- because icons and highlighting are awesome
This may be tricky as it requires a nerd-font to be installed.
( we now have nerdfont https://webinstall.dev/nerdfont )
This could be as simple as copying jq
or rg
and changing a few things:
rsync -av jq/ lsd/
lsd/release.js
to use this repolsd
unpack (i.e. as a single file? as a .tar.gz? as a .tar.gz with a folder named lsd?)
lsd/install.sh
following the example of either jq
or rg
lsd/install.ps1
following the example of either jq
or rg
lsd/README.md
bat
)mkdir
, ls
, tar
, unzip
)It's also okay to have multiple people work on part of this (i.e. the Cheat Sheet can be done independently from the install.sh
)
This should pretty much be copy/paste to get working, just needs 30-60 minutes to test and deploy.
Maybe this should be documented. Maybe it could be improved. Forgive my bad memory and poor search technique, this may be a duplicate.
I'm often in Linux as user ryan, and need to do things as root through sudo. Here is an example.
sudo $(which serviceman) add $(which caddy) run
I make it work using $()
.
If this is a good thing, perhaps it should be documented.
If there's a better way, enlighten me.
I want to have fish
without all of the hundreds of megabytes of brew
.
It may be installable locally (Mac only):
installer -pkg "$HOME/Downloads/fish-3.1.2.pkg" -target CurrentUserHomeDirectory
I've investigated goldmark, comrak, and pandoc. I like goldmark the best since it's written and go and is used by hugo, which we already have.
However, it looks like pandoc is the only one with a release API at the moment:
Mac file structure looks like this when unzipped:
pandoc-2.10.1
bin
pandoc
pandoc-citeproc
share
Should be easy to add following rg
as a template.
git clone --depth=1 https://github.com/Homebrew/brew "$HOME/.local/opt/brew"
pathman add "$HOME/.local/opt/brew/bin"
pathman add "$HOME/.local/opt/brew/sbin"
export PATH="$HOME/.local/opt/brew/bin:$PATH"
export PATH="$HOME/.local/opt/brew/sbin:$PATH"
brew update
See https://stackoverflow.com/questions/35775102/how-to-install-homebrew-packages-locally
โฏ webi rg
Downloading rg to /Users/ryan/Downloads/ripgrep-12.1.1-x86_64-apple-darwin.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 652 100 652 0 0 3243 0 --:--:-- --:--:-- --:--:-- 3243
100 1842k 100 1842k 0 0 3379k 0 --:--:-- --:--:-- --:--:-- 3379k
Extracting /Users/ryan/Downloads/ripgrep-12.1.1-x86_64-apple-darwin.tar.gz
Installing to /Users/ryan/.local/xbin/rg-12.1.1
rm: /Users/ryan/.local/bin/rg: No such file or directory
We need a way to signal to not upgrade.
For example, if we want to install prettier
or expo
, we should not require a node
upgrade to install it.
This is definitely different from the Github API, but similar.
See https://github.com/webinstall/packages/blob/master/flutter/versions.js
But should be more like #2
Now that the bash template has moved to webi/template.bash
we should we able to make a webi/test.js
or some such that makes it easy to test locally without running the server.
I'm thinking like this:
node webi/template.js ./my-new-project/
bash my-new-project-test.bash
Sidenote: might also want to change the structure to my-new-project/install.bash
rather than my-new-project/my-new-project.bash
. And make an _example
or _template
for people to copy from.
There is a release API, it's just not as well advertised. Gotta read the docs of the package rather than the web page:
https://git.rootprojects.org/api/swagger#/repository/repoListReleases
This appears to be exactly the same as Github. Need to confirm.
a suggestion to add something to the bat cheat sheet
if you're aliasing cat to bat, it would be nice to teach folks the way to bypass the alias
\cat foo
Three things to do:
Which looks like this:
12.16.3,lts,stable,2020-04-28,windows,amd64,zip,-,https://nodejs.org/dist/v12.16.3/node-v12.16.3-windows-x64.zip
2 . Split that string into variables
I also need to know the variable for the OS and ARCH.
I think %PROCESSOR_ARCHITECTURE%
is the best / most reliable for ARCH (i.e. AMD64
)?
Notes
You can use PowerShell commands from Batch, but I think it has to be batch and be able to run in cmd.exe because by default windows won't allow you to run PS1 scripts.
I was installing webi on WSL/Ubuntu in Windows. I got this error.
ryan@RYAN-WIN10:~$ webi pathman
Error: no 'pathman' release for 'windows' on 'amd64' as one of 'tar,exe,xz,git,dmg' by the tag ''
'pathman' is available for 'linux,macos,windows' on 'amd64' as one of 'zip'
(check that the package name and version are correct)
Double check at https://webinstall.dev/api/releases/[email protected]
I installed zip.
sudo apt install zip
Then it installed. But it wasn't that clear about what was going wrong.
Check this out!!
https://stackoverflow.com/a/40321310/151312
I definitely want to add that to webi
.
@ryanburnette This brings up the issue that we do need a way to have non-mac/non-linux (meaning Windows 10 only) installer pages.
Installed hugo on my 64-bit darwin os, but got 32-bit binary.
โฏ webi hugo
Found /Users/ryanburnette/Downloads/hugo_0.64.1_macOS-32bit.tar.gz
Extracting /Users/ryanburnette/Downloads/hugo_0.64.1_macOS-32bit.tar.gz
Installing to /Users/ryanburnette/.local/xbin/hugo-v0.64.1
Checking permission to execute 'hugo' on macOS 11+
Installed 'hugo' v0.64.1 as /Users/ryan/.local/bin/hugo
I also expected 0.73, but got 0.64.
I had occasion to install caddy on a server where I had already installed it previously. When I installed again with webi, it did everything it was supposed to, but the old caddy was the one I stll got as shown by which caddy
.
The installer output looked something like this
...
caddy may conflict with /root/bin/caddy
caddy install
Maybe the install message could be something like
caddy installed to ~/.local/bin/caddy
WARNING: ~/.local/bin/caddy may not be in $PATH
Just brain storming here.
before doing anything, webi should check itself before it wrecks itself... meaning, it should check to make sure it's up-to-date, update itself if necessary, and call itself again if an update occurred
I'm not really sure how to get the releases. I can't find a canonical source that lists versions that aren't the absolute latest.
I guess just scrape the html and pray that linux support returns soon? (nevermind, it won't.) Maybe cache old versions and check to see when they're removed?
Here's the script I use currently:
#!/bin/bash
echo "=== INSTALLING POSTGRES ==="
sleep 1
set -e
set -u
# Notes on convention:
# variables expected to be imported or exported are ALL_CAPS and prefixed with POSTGRES_
# variables expected to remain private are lowercase and prefixed as to not be affected by `source`
# source .env
DOWNLOADS_DIR=${DOWNLOADS_DIR:-"$HOME/Downloads"}
OPT_DIR=${OPT_DIR:-"$HOME/Applications"}
DATA_DIR=${DATA_DIR:-"$HOME/.local/share"}
POSTGRES_DATA_DIR=${POSTGRES_DATA_DIR:-"$DATA_DIR/postgres/var"}
mkdir -p "$DOWNLOADS_DIR"
mkdir -p "$OPT_DIR"
mkdir -p "$POSTGRES_DATA_DIR"
is_macos="$(uname -a | grep -i darwin)"
if [ -n "$is_macos" ]; then
TRASH_DIR=${TRASH_DIR:-"$HOME/.Trash"}
POSTGRES_VERSION=${POSTGRES_VERSION:-"10.13"} # 10.13-1
POSTGRES_BUILD=${POSTGRES_BUILD:-"1-osx"}
postgres_pkg="postgresql-${POSTGRES_VERSION}-${POSTGRES_BUILD}-binaries.zip"
is_zip="true"
else
TRASH_DIR=${TRASH_DIR:-"$HOME/tmp"}
POSTGRES_VERSION=${POSTGRES_VERSION:-"10.12"} # 10.12-1
POSTGRES_BUILD=${POSTGRES_BUILD:-"1-linux-x64"}
postgres_pkg="postgresql-${POSTGRES_VERSION}-${POSTGRES_BUILD}-binaries.tar.gz"
is_zip=""
fi
mkdir -p "$TRASH_DIR"
# https://www.enterprisedb.com/download-postgresql-binaries
postgres_tmp="$(mktemp -d -t postgres-installer.XXXXXXXX)"
postgres_unpack="pgsql"
postgres_dir="postgres-server-${POSTGRES_VERSION}"
postgres_lnk="postgres-server"
echo "Here's what this script will do:"
echo " โข Download postgres server v${POSTGRES_VERSION}"
echo " โข Install it to ${OPT_DIR}/${postgres_dir}"
echo " โข Link that to ${OPT_DIR}/${postgres_lnk}"
echo " โข Create a database in $POSTGRES_DATA_DIR (first-time only)"
echo " โข Start Postgres with $OPT_DIR/${postgres_lnk}/bin/pg_ctl"
echo ""
echo "Working directory is ${postgres_tmp}"
echo ""
if [ -f "${DOWNLOADS_DIR}/${postgres_pkg}" ]; then
rsync -aq "${DOWNLOADS_DIR}/${postgres_pkg}" "$postgres_tmp/$postgres_pkg"
else
echo "Downloading $postgres_pkg"
curl -fSL --progress-bar 'https://get.enterprisedb.com/postgresql/'"${postgres_pkg}"'?ls=Crossover&type=Crossover' -o "$postgres_tmp/$postgres_pkg"
rsync -aq "$postgres_tmp/$postgres_pkg" "${DOWNLOADS_DIR}/"
fi
pushd "$postgres_tmp" >/dev/null
if [ -n "$is_zip" ]; then
unzip -q "$postgres_pkg"
else
tar xvf "$postgres_pkg"
fi
mv "$postgres_unpack" "$postgres_dir"
popd >/dev/null
if [ -d "$OPT_DIR/$postgres_dir" ]; then
mv "$OPT_DIR/$postgres_dir" "$TRASH_DIR/$postgres_dir".$(date '+%Y-%m-%d_%H-%M-%S' )
echo "moved old $OPT_DIR/$postgres_dir to the Trash folder"
fi
mv "$postgres_tmp/$postgres_dir" "$OPT_DIR/"
rm -f "$OPT_DIR/$postgres_lnk"
ln -s "$OPT_DIR/$postgres_dir" "$OPT_DIR/$postgres_lnk"
mkdir -p "$POSTGRES_DATA_DIR"
chmod 0700 "$POSTGRES_DATA_DIR"
if [ ! -f "$POSTGRES_DATA_DIR/postgresql.conf" ]; then
echo "postgres" > "${postgres_tmp}/pwfile"
"$OPT_DIR/$postgres_lnk/bin/initdb" \
-D "$POSTGRES_DATA_DIR/" \
--username postgres --pwfile "${postgres_tmp}/pwfile" \
--auth-local=password --auth-host=password
fi
echo "PostgreSQL installed, database initialized in $POSTGRES_DATA_DIR/"
rm -rf "${postgres_tmp}"
The link to the magic is error 410
https://github.com/webinstall/packages/blob/master/node/install.sh#L7
Obviously you think that the thing you're proposing that we add is awesome.
Be sure to let us know! Don't bury the lead.
Please include or link to a screenshot, asciinema, or 5-10 second screencast, if at all possible.
Webi
?brew
and apt
are for complex things.
webi
is for simple things.
The more of these boxes you can check, the more likely it is that we'd love to have it:
~/.local/opt/<pkg>
), No dependenciescoreutils
, and programming platformsThere are exceptions, of course. We also host a few standalone utility scripts (myip
, ssh-pubkey
) and shortcuts for other installers (brew
, rust
).
In the case where there are multiple similar tools, we prefer to just add the one that checks the most boxes.
If it's hosted on Github, all you have to do is copy rg/release.js
and change the github owner and package name to the one you want to submit.
webi
, by default, will handle almost all of the plumbing for your package.
SINGLE=true
be set?SINGLE=true
simply defines that the binary will end up in ~/.local/bin/
rather than ~/.local/opt/<pkg>/bin/
and causes a few changes to be made accordingly.
When the bash functions that you provide run, the current working directory will be a temporary directory into which the package has been unpacked.
Using ripgrep as an example, this what is done just before your pkg_install
function is called:
Here's an example of what we need to know, using ripgrep
as an example:
pushd /tmp
# What's the release API?
wget https://github.com/BurntSushi/ripgrep/releases/download/12.1.1/ripgrep-12.1.1-x86_64-apple-darwin.tar.gz
# What's the directory structure when it unpacks?
mkdir ripgrep
pushd ripgrep
tar xvf ../ripgrep-12.1.1-x86_64-apple-darwin.tar.gz
find .
.
./ripgrep-12.1.1-x86_64-apple-darwin
./ripgrep-12.1.1-x86_64-apple-darwin/complete
./ripgrep-12.1.1-x86_64-apple-darwin/complete/_rg
./ripgrep-12.1.1-x86_64-apple-darwin/complete/_rg.ps1
./ripgrep-12.1.1-x86_64-apple-darwin/complete/rg.bash
./ripgrep-12.1.1-x86_64-apple-darwin/complete/rg.fish
./ripgrep-12.1.1-x86_64-apple-darwin/COPYING
./ripgrep-12.1.1-x86_64-apple-darwin/doc
./ripgrep-12.1.1-x86_64-apple-darwin/doc/CHANGELOG.md
./ripgrep-12.1.1-x86_64-apple-darwin/doc/FAQ.md
./ripgrep-12.1.1-x86_64-apple-darwin/doc/GUIDE.md
./ripgrep-12.1.1-x86_64-apple-darwin/doc/rg.1
./ripgrep-12.1.1-x86_64-apple-darwin/LICENSE-MIT
./ripgrep-12.1.1-x86_64-apple-darwin/README.md
./ripgrep-12.1.1-x86_64-apple-darwin/rg
./ripgrep-12.1.1-x86_64-apple-darwin/UNLICENSE
Your pkg_install
basically just needs to identify the main file or directory that needs to be moved. In this case that would be ./ripgrep-12.1.1-x86_64-apple-darwin/rg
.
This means that the install function is going to need to look something like this:
```bash
pkg_install() {
mv ./ripgrep*/rg "$pkg_src"
}
Where "$pkg_src"
is a variable that's set up by webi
.
We also need to know how to get just the version string from rg
, which turns out to look like this:
rg --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2
With that information (above), you can copy and paste from the _example
package, change the parts that need changing, and you're done.
In many cases, nothing needs to change other than the name.
Copy and paste jq/README.md
, update the metadata (official URL, tagline, etc) and add a cheat sheet for how to do a few common things.
_example
needs updateI want to make a video for how to submit a PR to add a project to webi.
releases.js
- should point to github project, or use custom APIREADME.md
- update metadata (yaml-ish format)WSL presents an interesting situation
I tried installing Node, but I get node.exe
ryan@RYAN-WIN10:~$ webi node@lts
Downloading node to /home/ryan/Downloads/node-v12.18.2-win-x64.zip
/home/ryan/Downloads/node-v12 100%[=================================================>] 17.87M 45.3MB/s in 0.4s
Extracting /home/ryan/Downloads/node-v12.18.2-win-x64.zip
Installing to /home/ryan/.local/opt/node-v12.18.2/bin/node
mv: cannot move './node-v12.18.2-win-x64' to '/home/ryan/.local/opt/node-v12.18.2/node-v12.18.2-win-x64': Directory not empty
[email protected]: line 311: /home/ryan/.local/opt/node-v12.18.2/bin/node: No such file or directory
And node.exe
is no good in this environment.
Pathman's release.js
needs to be updated to select pathman.debug.exe for windows, maybe, so that pathman will output text in Terminal.
Or in some way shape or form we need to choose between GUI-enabled and Terminal-enabled pathman.
Also, not sure what the difference between these two might be or which should be added:
.local\bin
%USERPROFILE%\.local\bin
Also, using quotes seem to mess up the pathnames.
Also, pathman sometimes seems to cause hangs (potentially after modifying the registry?) but then continues when 'enter' is pressed.
cc/ @jkunkee Thoughts?
Currently we show were a download will be downloaded:
Downloading node to /Users/aj/Downloads/node-v14.7.0-darwin-x64.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 30.2M 100 30.2M 0 0 879k 0 0:00:35 0:00:35 --:--:-- 987k
To increase transparency and trust, it may be good to show where the download is coming from:
Downloading https://nodejs.org/dist/v12.18.3/node-v12.18.3-darwin-x64.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 30.2M 100 30.2M 0 0 879k 0 0:00:35 0:00:35 --:--:-- 987k
Saved node to /Users/aj/Downloads/node-v12.18.3-darwin-x64.tar.gz
Two things that need to be solved for here:
webi_download
function _webi/template.sh
with the new wordingmkdir
, ls
, tar
, unzip
)It's fine for the display to be brainstormed by one person and the implementation to be done by another. However, this is probably basic enough for anyone with minimal bash experience to make the change.
Would be nice to have a little bash / pwsh script for updating domains
https://www.duckdns.org/spec.jsp
https://www.duckdns.org/update?domains={YOURVALUE}&token={YOURVALUE}[&ip={YOURVALUE}][&ipv6={YOURVALUE}][&verbose=true][&clear=true]
Perhaps could ask questions and store secrets in ~/.config/duckdns.org/config
?
Would be great to store secrets in the native secret manager of the OS, but not sure how to do that yet.
Curlie wraps curl to behave similar to HTTPie (syntax highlighting and such), but in Go rather than Python, and hence easier to install. Again, github releases, should just be copy/paste/test.
bat is cat with wings - a code aware pager
fd finds better
hexyl is a hex viewer with type highlighting
me: I want a hugo installer
aj: you can make it yourself
me: i'll try
TODO:
npm --scripts-prepend-node-path=true run your-script-name
npm config set scripts-prepend-node-path=true
I think I had this there, need to add it back again.
I could use a gitea installer.
Why does go install to ~.go
while most other things install under ~/.local
?
I used ./bat
as a template and made a few changes to accommodate ./comrak
.
I'd like to give the author a chance to make any comments, or PR if desired, after that this should be good to go live in production.
In development at https://beta.webinstall.dev/comrak
This is the current cheatsheet, install files, and releases API for installing ad using comrak:
comrak/README.md
:
---
title: Comrak
homepage: https://github.com/kivikakk/comrak
tagline: |
Comrak is a Rust port of github's cmark-gfm.
---
### Updating `comrak`
```bash
webi comrak@stable
```
Use the `@beta` tag for pre-releases.
## Cheat Sheet
> Comrak supports the five extensions to CommonMark defined in the GitHub
> Flavored Markdown Spec: Tables, Task list items, Strikethrough, Autolinks, &
> Disallowed Raw HTML
<!-- TODO ask about ~/.comrakrc -->
### Convert _trusted_ Markdown files to HTML
```bash
comrak --unsafe --gfm --github-pre-lang --header-ids '' README.md
```
comrak/install.sh
:
#!/bin/bash
{
set -e
set -u
##################
# Install comrak #
##################
WEBI_SINGLE=true
pkg_get_current_version() {
# 'comrak --version' has output in this format:
# comrak 0.8.1
# This trims it down to just the version number:
# 0.8.1
echo $(comrak --version 2>/dev/null | head -n 1 | cut -d' ' -f 2)
}
pkg_install() {
# ~/.local/bin
mkdir -p "$pkg_src_bin"
# mv ./comrak* ~/.local/opt/comrak-v0.8.1/bin/comrak
mv ./comrak* "$pkg_src_cmd"
# chmod a+x ~/.local/opt/comrak-v0.8.1/bin/comrak
chmod a+x "$pkg_src_cmd"
}
}
comrak/install.ps1
:
#!/usr/bin/env pwsh
$VERNAME = "$Env:PKG_NAME-v$Env:WEBI_VERSION.exe"
$EXENAME = "$Env:PKG_NAME.exe"
# Fetch archive
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"))
{
# TODO: arch detection
echo "Downloading $Env:PKG_NAME from $Env:WEBI_PKG_URL to $Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE.part"
& move "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE.part" "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"
}
IF (!(Test-Path -Path "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERSION\bin\$VERNAME"))
{
echo "Installing $Env:PKG_NAME"
# TODO: temp directory
# Enter tmp
pushd .local\tmp
# Remove any leftover tmp cruft
Remove-Item -Path "$Env:PKG_NAME-v*" -Recurse -ErrorAction Ignore
# Move single binary into root of temporary folder
& move "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE" "$VERNAME"
& dir
# Settle unpacked archive into place
echo "New Name: $VERNAME"
echo "New Location: $Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERSION\bin\$VERNAME"
New-Item "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERSION\bin" -ItemType Directory
Move-Item -Path "$VERNAME" -Destination "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERSION\bin"
# Exit tmp
popd
}
echo "Copying into '$Env:USERPROFILE\.local\bin\$EXENAME' from '$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERSION\bin\$VERNAME'"
Remove-Item -Path "$Env:USERPROFILE\.local\bin\$EXENAME" -Recurse -ErrorAction Ignore
Copy-Item -Path "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERSION\bin\$VERNAME" -Destination "$Env:USERPROFILE\.local\bin\$EXENAME" -Recurse
comrak/release.js
:
'use strict';
var github = require('../_common/github.js');
var owner = 'kivikakk';
var repo = 'comrak';
module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
return all;
});
};
if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
all = require('../_webi/normalize.js')(all);
all.releases = all.releases.slice(0, 10);
//console.info(JSON.stringify(all));
console.info(JSON.stringify(all, null, 2));
});
}
We want to add sd
because it works consistently across Windows, Mac, and Linux.
(sed
is not as easy to get on Windows, and works differently between GNU and BSD builds).
This could be as simple as copying _example
(or bat
or rg
) and changing a few things.
mkdir
, mv
, ls
, tar
, unzip
, variables)git clone [email protected]:webinstall/packages.git
pushd packages/
npm install
rsync -av _example/ sd/
sd/release.js
to use the official reposd
unpacks (i.e. as a single file? as a .tar.gz? as a .tar.gz with a folder named sd?)sd/install.sh
(see bat
and jq
as examples)sd/install.ps1
(see bat
and jq
as examples)sd/README.md
sed
)It's also okay to have multiple people work on part of this (i.e. the Cheat Sheet can be done independently from the install.sh
)
The deno download name doesn't include the version and therefore the cached version is used.
Found /Users/aj/Downloads/deno-x86_64-apple-darwin.zip # <==== problem
Extracting /Users/aj/Downloads/deno-x86_64-apple-darwin.zip
Installing to /Users/aj/.local/opt/deno-v1.3.0/bin/deno # <==== wrong version!
Checking permission to execute 'deno' on macOS 11+
Installed 'deno' v1.3.0 as /Users/aj/.local/bin/deno
rm -rf ~/Downloads/deno-* ~/.local/opt/deno-v1.3.0
curl -fsS https://webinstall.dev/[email protected] | bash
The pkg
version should never sort before the equivalent tar
version.
a great cross-platform language-agnostic file watcher / task runner
Re-installing a previously installed version should just switch symlinks.
webi node@v12 # install
webi node@v14 # install
webi node@v12 # swap symlinks
xvm node@v12
Make a bash script xvm
that tries to switch to an installed version matching node
and v12.x
, and falls back to webi node@v12
otherwise.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.