Skip to content

Commit 140228e

Browse files
committed
plutools -> getserve.rs
1 parent feeda2e commit 140228e

File tree

5 files changed

+23
-22
lines changed

5 files changed

+23
-22
lines changed

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55

6-
# Plutonium Updater CLI [![alt text](https://plutools.pw/assets/img/plutools_64.png)](https://plutools.pw/) [![alt text](http://i.epvpimg.com/2m4qdab.png)](https://discord.gg/SnJQusteNZ)
6+
# Plutonium Updater CLI [![alt text](github_assets/logo.png)](https://plutools.pw/) [![alt text](github_assets/discord.png)](https://discord.gg/SnJQusteNZ)
77

88
![](github_assets/preview.gif)
99

@@ -85,12 +85,11 @@ or
8585
- Returns latest version number
8686
- ```--no-color```
8787
- Disable colors
88-
- ```--plutools-list```
89-
- List revisions archived by plutools.pw
90-
- ```--plutools <revision>```
91-
- Install revision archived by plutools.pw
92-
- Use ```-f``` when downgrading
93-
- :warning: Third-party hosted binary files :warning:
88+
- ```--archive-list``` | ~~```--plutools-list```~~
89+
- List revisions archived on plutonium-archive.getserve.rs
90+
- ```--archive <revision>``` | ~~```--plutools```~~
91+
- Install revision archived on plutonium-archive.getserve.rs
92+
- Downgrading is not recommended, use an empty directory instead. If downgrading use ```-f```.
9493
- ```--backup```
9594
- Create backup of current version while updating
9695
- ```--manual-backup```
@@ -116,6 +115,6 @@ or
116115
2. Clone the repo
117116
3. Build
118117
- ```cargo build --release```
119-
4. (Linux/Optional) Strip binary
118+
4. (Linux/Optional) Strip binary
120119
- ```strip target/release/plutonium-updater```
121120
5. Grab binary from ```target/release/plutonium-updater(.exe)```

github_assets/discord.png

2.77 KB
Loading

github_assets/logo.png

7.18 KB
Loading

src/args.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ pub struct Args {
3131
#[clap(long)]
3232
pub no_color: bool,
3333

34-
/// List revisions archived by plutools
35-
#[clap(long)]
36-
pub plutools_list: bool,
34+
/// List archived revisions from plutonium-archive.getserve.rs
35+
#[clap(long, alias = "plutools-list")]
36+
pub archive_list: bool,
3737

38-
/// Install revision archived by plutools | WARNING: Third-party hosted files
39-
#[clap(long, default_value = "0")]
40-
pub plutools: String,
38+
/// Install archived revision from plutonium-archive.getserve.rs
39+
#[clap(long, default_value = "0", alias = "plutools")]
40+
pub archive: String,
4141

4242
/// Create backup of current version while updating
4343
#[clap(long)]

src/main.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ fn copy_if_exists(origin: &Path, destination: &Path) {
9292
// https://stackoverflow.com/a/58063083
9393
fn get_subdirs(dir: &Path) -> Result<Vec<PathBuf>, io::Error> {
9494
Ok(fs::read_dir(dir)?
95-
.into_iter()
9695
.filter(|r| r.is_ok())
9796
.map(|r| r.unwrap().path())
9897
.filter(|r| r.is_dir())
@@ -128,7 +127,7 @@ fn copy_version(info: &CdnInfo, source_dir: &Path, destination_dir: &Path) {
128127

129128
fn get_archived_revisions() -> Vec<u16> {
130129
let archive_revisions: Vec<u16> = DeJson::deserialize_json(&http::get_body_string(
131-
"https://updater-archive.plutools.pw/revisions.json",
130+
"https://plutonium-archive.getserve.rs/revisions.json",
132131
))
133132
.unwrap();
134133
archive_revisions
@@ -146,7 +145,10 @@ fn display_archived_revisions() {
146145
fn get_archive_url(revision: u16) -> String {
147146
let archive_revisions = get_archived_revisions();
148147
if archive_revisions.contains(&revision) {
149-
format!("https://updater-archive.plutools.pw/{}/info.json", revision)
148+
format!(
149+
"https://plutonium-archive.getserve.rs/{}/info.json",
150+
revision
151+
)
150152
} else {
151153
panic!("Revision {} is not available in the archive.", revision);
152154
}
@@ -367,13 +369,13 @@ fn main() {
367369
let args = args::get();
368370
setup_env(args.no_color);
369371

370-
let plutools_revision: u16 = args
371-
.plutools
372+
let archive_revision: u16 = args
373+
.archive
372374
.parse()
373375
.unwrap_or_else(|_| panic!("{}: {}", "Error".bright_red(), "Invalid archived version"));
374376

375-
let cdn = if plutools_revision > 0 {
376-
get_archive_url(plutools_revision)
377+
let cdn = if archive_revision > 0 {
378+
get_archive_url(archive_revision)
377379
} else {
378380
args.cdn_url.to_string()
379381
};
@@ -400,7 +402,7 @@ fn main() {
400402
}
401403
}
402404

403-
if args.plutools_list {
405+
if args.archive_list {
404406
display_archived_revisions();
405407
std::process::exit(0);
406408
}

0 commit comments

Comments
 (0)