Compare commits

..
4 Commits
Author SHA1 Message Date
meehl e2c0f2fffc chore: Release rusty-path-of-building version 0.2.14
Release / create-release (push) Successful in 6s
2026-03-14 10:35:33 +01:00
meehl a6be413190 Update CHANGELOG 2026-03-14 10:35:21 +01:00
AiSatan 8034eef8c7 fix removing build directory 2026-03-11 16:48:11 +01:00
meehl 3b0d5295d3 installer: only install release versions
This prevents the installer from trying to download a beta version which
leads to a 404.
2026-03-10 16:07:54 +01:00
6 changed files with 36 additions and 10 deletions

No files matched your search

+9 -1
View File
@@ -2,6 +2,13 @@
## [Unreleased] - ReleaseDate
## [0.2.14] - 2026-03-14
### Fixed
- Fix deletion of character build directories
- Prevent installer from downloading beta versions
## [0.2.13] - 2026-03-09
### Fixed
@@ -167,8 +174,9 @@
- First release
<!-- next-url -->
[Unreleased]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.13...HEAD
[Unreleased]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.14...HEAD
[0.2.14]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.13...v0.2.14
[0.2.13]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.12...v0.2.13
[0.2.12]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.11...v0.2.12
[0.2.11]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.10...v0.2.11
Generated
+1 -1
View File
@@ -2506,7 +2506,7 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
[[package]]
name = "rusty-path-of-building"
version = "0.2.13"
version = "0.2.14"
dependencies = [
"ahash",
"anyhow",
+1 -1
View File
@@ -4,7 +4,7 @@ authors = ["meehl"]
description = "Cross-platform runtime for Path of Building"
repository = "https://github.com/meehl/rusty-path-of-building"
license = "MIT"
version = "0.2.13"
version = "0.2.14"
edition = "2024"
publish = false
+3 -1
View File
@@ -9,7 +9,8 @@ use crate::{
input::{get_cursor_pos, is_key_down},
lua::{load_module, protected_call, protected_load_module},
paths::{
get_runtime_path, get_script_path, get_user_path, get_work_dir, make_dir, set_work_dir,
get_runtime_path, get_script_path, get_user_path, get_work_dir, make_dir, remove_dir,
set_work_dir,
},
rendering::PoBString,
search_handle::new_search_handle,
@@ -51,6 +52,7 @@ pub fn register_globals(lua: &Lua) -> LuaResult<()> {
globals.set("GetWorkDir", lua.create_function(get_work_dir)?)?;
globals.set("SetWorkDir", lua.create_function(set_work_dir)?)?;
globals.set("MakeDir", lua.create_function(make_dir)?)?;
globals.set("RemoveDir", lua.create_function(remove_dir)?)?;
// console
globals.set("ConPrintf", lua.create_function(console_printf)?)?;
+12
View File
@@ -47,3 +47,15 @@ pub fn make_dir(l: &Lua, path: String) -> LuaResult<MultiValue> {
Err(err) => Ok((Value::Nil, err.to_string()).into_lua_multi(l)?),
}
}
pub fn remove_dir(l: &Lua, (path, recursive): (String, Option<bool>)) -> LuaResult<MultiValue> {
let result = if recursive.unwrap_or(false) {
fs::remove_dir_all(&path)
} else {
fs::remove_dir(&path)
};
match result {
Ok(_) => Ok(Value::Boolean(true).into_lua_multi(l)?),
Err(err) => Ok((Value::Nil, err.to_string()).into_lua_multi(l)?),
}
}
+10 -6
View File
@@ -11,7 +11,6 @@ use crate::{
use flate2::read::GzDecoder;
use parley::{FontFamily, GenericFamily};
use regex::Regex;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use std::{
fs::{self},
io::copy,
@@ -19,9 +18,15 @@ use std::{
sync::mpsc::{self, Receiver, TryRecvError},
thread,
};
use std::{
sync::LazyLock,
time::{Duration, SystemTime, UNIX_EPOCH},
};
use ureq::{Agent, http::Response};
const REPO_NAME: &str = "meehl/rusty-pob-manifest";
static VERSION_RE: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"^(\d+)\.(\d+)\.(\d+)$").unwrap());
enum DownloadProgress {
Percentage(f32), // percentage of total size (between 0 and 1)
@@ -236,6 +241,9 @@ fn fetch_compatibility_info(game: Game) -> anyhow::Result<Vec<VersionReq>> {
Ok(compatibility_table
.pairs::<String, String>()
.filter_map(|p| p.ok())
// filter out beta versions. beta version adds a suffix to the version string which is not
// matched by the version regex resulting in them being filtered out
.filter(|(pob_version, _)| VERSION_RE.is_match(pob_version))
.map(|(pob_version, min_req_rpob_ver)| VersionReq {
pob_ver: pob_version,
min_rpob_ver: min_req_rpob_ver,
@@ -359,8 +367,6 @@ fn download_path_of_building<P: AsRef<Path>>(
/// Replaces UpdateCheck with rusty-path-of-building's modified version
fn replace_updatecheck<P: AsRef<Path>>(target_dir: P) -> anyhow::Result<()> {
log::info!("Downloading modified UpdateCheck.lua script...");
download_file(
&format!(
"https://raw.githubusercontent.com/{REPO_NAME}/main/{}",
@@ -570,10 +576,8 @@ fn http_get_with_backoff(url: &str) -> anyhow::Result<Response<ureq::Body>> {
/// Compares two SemVer versions and returns true if v2 is higher or equal than v1
fn is_higher_version(v1: &str, v2: &str) -> anyhow::Result<bool> {
let re = Regex::new(r"^(\d+)\.(\d+)\.(\d+)$").unwrap();
let parse_version = |v: &str| -> anyhow::Result<(u32, u32, u32)> {
let caps = re
let caps = VERSION_RE
.captures(v)
.ok_or_else(|| anyhow::anyhow!("Invalid semver format: {}", v))?;