File tree 5 files changed +12
-3
lines changed
5 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
1
//! Generate metadata for installer artifacts
2
+
2
3
use anyhow:: Context ;
3
4
use std:: path:: Path ;
4
5
use tokio:: {
@@ -8,7 +9,10 @@ use tokio::{
8
9
9
10
use mullvad_update:: { format, hash} ;
10
11
11
- /// Generate `format::Installer`
12
+ /// Generate `format::Installer` for a given `artifact`.
13
+ ///
14
+ /// The presence of the files relative to `base_urls` is not verified.
15
+ /// See [crate::config::Config::base_urls] for the assumptions made.
12
16
pub async fn generate_installer_details (
13
17
architecture : format:: Architecture ,
14
18
base_urls : & [ String ] ,
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ pub struct Config {
15
15
}
16
16
17
17
impl Config {
18
+ /// Try to load [CONFIG_FILENAME] from the working directory, create one if it does not exist.
18
19
pub async fn load_or_create ( ) -> anyhow:: Result < Self > {
19
20
match fs:: read_to_string ( CONFIG_FILENAME ) . await {
20
21
Ok ( toml_str) => toml:: from_str ( & toml_str) . context ( "Failed to parse TOML file" ) ,
Original file line number Diff line number Diff line change
1
+ //! Tools for the GitHub repository.
2
+
1
3
use anyhow:: Context ;
2
4
3
- // Obtain changes.txt for a given version/tag from the GitHub repository
5
+ /// Obtain changes.txt for a given version/tag from the GitHub repository
4
6
pub async fn fetch_changes_text ( version : & mullvad_version:: Version ) -> anyhow:: Result < String > {
5
7
let github_changes_url = format ! ( "https://raw.githubusercontent.com/mullvad/mullvadvpn-app/refs/tags/{version}/desktop/packages/mullvad-vpn/changes.txt" ) ;
6
8
let changes = reqwest:: get ( github_changes_url)
Original file line number Diff line number Diff line change
1
+ //! File and I/O utilities
2
+
1
3
use std:: path:: Path ;
2
4
3
5
use anyhow:: Context ;
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ impl Platform {
140
140
141
141
let signed_path = self . signed_path ( ) ;
142
142
143
- // Confirm if file exists
143
+ // Require confirmation if a signed file exists
144
144
if !assume_yes && signed_path. exists ( ) {
145
145
let msg = format ! (
146
146
"This will replace the existing file at {}. Continue?" ,
You can’t perform that action at this time.
0 commit comments