self_update Provides updaters for updating rust executables in-place from various release distribution backends.
Usage
Update (replace) the current executable with the latest release downloaded from https://api.github.com/repos/jaemk/self_update/releases/latest
. Note, the , trust project provides a nice setup for producing release-builds via CI (travis / appveyor).
crate self_update; fn() -> (Result) Box () let (status)=(self_update) :: backends :: (github) :: (Update) :: configure
in action:() .repo_owner ("jaemk".repo_name (“self_update”. bin_name ( “self_update_example”. show_download_progress ()(true) . current_version ( cargo_crate_version! ()) . build ()? . () ?; println! (cargo run --example github
Amazon S3 is also supported as the backend to check for new releases. Provided a
bucket_name
and
asset_prefix
string,
self_update
will look up all matching files using the following format as a convention for the filenames:
-
- . Any file not matching the format, or not matching the provided prefix string, is be ignored.
(fn() ->{ let (status)=(self_update) :: backends :: (s3) :: (Update) :: configure() . bucket_owner (“self_update_releases”. asset_prefix (“self_update”.region ( eu- west-2 ". bin_name ( “self_update_example”. show_download_progress ()(true) . current_version ( cargo_crate_version! ()) . build ()? . () ?; println! ()S3 Update status: `{}`! ''
, status. (version) ()); Ok (()) } # fn () main) () {} <::std::error::error>Separate utilities are also exposed:
externcrateself_update; fn
() -> (Result) Box () let releases
=(self_update) :: backends :: (github) :: (ReleaseList) :: configure
() .repo_owner ("jaemk".repo_name (“self_update”. build ()? .fetch () ?; println! ()found releases : "; println! () ({ {: #?} n, releases); // get the first available release let (asset)=releases [0] .asset_for () (& self_update : get_target ()). unwrap ();
let (tmp_dir=(self_update) (:: TempDir) ::
GIPHY App Key not set. Please check settings