Skip to content

Batch release downloader & updater (e.g. from GitHub releases). Uses GitHub CLI (gh) & token.

License

Notifications You must be signed in to change notification settings

kstr0k/release-batch-dlupd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

release-batch-dlupd

Download & update packages, e.g. from GitHub releases. Features:

  • uses GitHub CLI gh (required) & token, avoiding rate limits
  • can detect updates even for fixed release URLs / tags (e.g. releases/tag/continuous) using the GitHub API

Usage

See release-batch-dlupd --help:

release-batch-dlupd [OPTION]...

OPTIONS

--help, -h

this help ("-?": show defaults)

--root=ROOT

all configs (per-package & global) + downloads

--create=URL

URL / "true"; creates ROOT first if inexistent.

--update=PKG

true (all) / false / PKG subdir path (abs. / relative to ROOT)

Shorthand (bools): --OPT is --OPT=true, --no-OPT is --OPT=false

ROOT default: my dirname (if I was invoked through a symlink: target's dirname)

URL (--create):

https://github.com/OWNER/NAME/releases/latest

latest release

https://github.com/OWNER/NAME/releases/tag/TAG

specific release

true

this package

--create[=true] configures a package subdir for my latest release, updates & symlinks ROOT/op to my latest version (i.e. ROOT/op implies --root=ROOT).

PACKAGE SUBDIRS

Register packages by creating ROOT/p/PKG subdirs, where PKG is the download URL (no https). --create=https://... does so automatically (see patterns above; view the results of --create[=true]). Within a subdir:

%cfg%/

configure downloads (presence identifies a package subdir)

%dl%/

downloaded assets

%state%/

current package version etc. Wipe it (rm -rf) to reset.

Config files (%cfg%/*):

asset/glob.txt

one pattern / line.

bin/preupd

runs once per package when updates found

bin/postupd

runs when downloads complete

Default scripts (--create):

preupd

rm -rf %dl%/* (--update skips existing!)

postupd

chmod a+x %dl%/* (too broad but simple)

Copyright

Alin Mr. (almr.oss at outlook.com) / MIT license