Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,003 changes: 1,397 additions & 606 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2024"
repository = "https://github.com/QuestPackageManager/QPM.CLI"

rust-version = "1.85"
rust-version = "1.90"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

# Rename binary
Expand All @@ -17,10 +17,11 @@ required-features = []


[features]
default = ["templatr", "network_test", "cli", "gitoxide"]
default = ["templatr", "network_test", "cli", "gitoxide", "quest_emu"]
templatr = ["dep:templatr"]
cli = ["dep:clap", "dep:clap_complete", "dep:vergen", "dep:pbr"]
gitoxide = ["dep:gix"]
quest_emu = ["dep:quest_emu"]
network_test = []

[build-dependencies]
Expand All @@ -35,7 +36,7 @@ color-eyre = { version = "0.6", default-features = false }
[dev-dependencies]
assert_cmd = "2.0.14"
predicates = "3.1.0"
tempfile = "3.10.1"
tempfile = "3.23"
assert_fs = "1.1.0"
fs_extra = "1.3.0"
walkdir = "2.4.0"
Expand All @@ -47,6 +48,8 @@ qpm_package = { git = "https://github.com/QuestPackageManager/QPM.Package.git",
qpm_qmod = { git = "https://github.com/QuestPackageManager/QPM.Qmod.git" }
qpm_arg_tokenizer = { git = "https://github.com/QuestPackageManager/QPM.arg_tokenizer.git" }
templatr = { git = "https://github.com/QuestPackageManager/templatr.git", optional = true }
quest_emu = { git = "https://github.com/Fernthedev/quest_emu_setup.git", optional = true }

pathdiff = "0.2"

# No need for tracing support
Expand Down Expand Up @@ -89,7 +92,7 @@ gix = { version = "*", features = [
], optional = true, default-features = false }

# Use PR with symlink fix for Unix systems.
zip = { version = "4", default-features = false, features = [
zip = { version = "6", default-features = false, features = [
"zstd",
"nt-time",
"deflate",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/dependency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use semver::{Version, VersionReq};

use crate::{
models::package::{PackageConfigExtensions, SharedPackageConfigExtensions},
repository::{self, Repository, local::FileRepository},
repository::{self, Repository},
terminal::colors::QPMColor,
};

Expand Down
21 changes: 12 additions & 9 deletions src/commands/doctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,18 @@ impl Command for DoctorCommand {
if File::open("./qpm.json").is_ok() {
let ndk_path = env::var("ANDROID_NDK_HOME");

if ndk_path.is_ok() {
println!("NDK {} found in path!", ndk_path.unwrap());
} else if let Err(err) = ndk_path
&& File::open("./ndkpath.txt").is_err()
{
return Err(anyhow!(
"No ndkpath.txt or ANDROID_NDK_HOME environment variable found!"
)
.error(err));
match ndk_path {
Ok(ndk) => {
println!("NDK {} found in path!", ndk);
}
Err(err) => {
if File::open("./ndkpath.txt").is_err() {
return Err(anyhow!(
"No ndkpath.txt or ANDROID_NDK_HOME environment variable found!"
)
.error(err));
}
}
}
};

Expand Down
14 changes: 14 additions & 0 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ pub enum MainCommand {
#[cfg(feature = "templatr")]
Templatr(templatr::TemplatrCommand),

#[cfg(feature = "quest_emu")]
Emu {
yes: bool,
#[command(subcommand)]
main_command: quest_emu::commands::MainCommand,
},

Version(version::VersionCommand),

#[command(hide = true)]
Expand Down Expand Up @@ -104,8 +111,15 @@ impl Command for MainCommand {
MainCommand::Scripts(s) => s.execute(),
MainCommand::Version(v) => v.execute(),
MainCommand::GenSchema(g) => g.execute(),

#[cfg(feature = "templatr")]
MainCommand::Templatr(c) => c.execute(),

#[cfg(feature = "quest_emu")]
MainCommand::Emu { yes, main_command } => quest_emu::commands::Command::execute(
main_command,
&quest_emu::commands::GlobalContext { yes },
),
}
}
}
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(try_find)]
#![feature(iterator_try_collect)]
#![feature(let_chains)]
#![feature(exit_status_error)]
#![feature(if_let_guard)]
#![feature(path_add_extension)]

Check warning on line 5 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build / build (ubuntu-latest, qpm, linux-x64-musl, x86_64-unknown-linux-musl)

the feature `path_add_extension` has been stable since 1.91.0 and no longer requires an attribute to enable

Check warning on line 5 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build / build (ubuntu-latest, qpm, linux-x64)

the feature `path_add_extension` has been stable since 1.91.0 and no longer requires an attribute to enable

Check warning on line 5 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build / build (ubuntu-latest, qpm, linux-x64)

the feature `path_add_extension` has been stable since 1.91.0 and no longer requires an attribute to enable

Check warning on line 5 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build / build (windows-latest, qpm.exe, aarch64-pc-windows-msvc, windows-arm64)

the feature `path_add_extension` has been stable since 1.91.0 and no longer requires an attribute to enable

Check warning on line 5 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build / build (macos-13, qpm, macos-arm64, aarch64-apple-darwin)

the feature `path_add_extension` has been stable since 1.91.0 and no longer requires an attribute to enable

Check warning on line 5 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build / build (windows-latest, qpm.exe, windows-x64)

the feature `path_add_extension` has been stable since 1.91.0 and no longer requires an attribute to enable

Check warning on line 5 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build / build (windows-latest, qpm.exe, windows-x64)

the feature `path_add_extension` has been stable since 1.91.0 and no longer requires an attribute to enable

Check warning on line 5 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build / build (macos-13, qpm, macos-x64)

the feature `path_add_extension` has been stable since 1.91.0 and no longer requires an attribute to enable

Check warning on line 5 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build / build (macos-13, qpm, macos-x64)

the feature `path_add_extension` has been stable since 1.91.0 and no longer requires an attribute to enable

#[cfg(feature = "cli")]
pub mod commands;
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![feature(try_find)]
#![feature(iterator_try_collect)]
#![feature(let_chains)]
#![feature(exit_status_error)]
#![feature(if_let_guard)]
#![feature(path_add_extension)]
Expand Down
2 changes: 1 addition & 1 deletion src/repository/local.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use color_eyre::{
Result,
eyre::{Context, ContextCompat, OptionExt, bail, ensure},
eyre::{Context, OptionExt, bail, ensure},
};
use itertools::Itertools;
use owo_colors::OwoColorize;
Expand Down
12 changes: 6 additions & 6 deletions src/terminal/colors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@ use owo_colors::{FgColorDisplay, OwoColorize};
/// Defines a color scheme for Spiggy
pub trait QPMColor: OwoColorize {
#[inline(always)]
fn download_file_name_color(&self) -> FgColorDisplay<owo_colors::colors::Cyan, Self> {
fn download_file_name_color(&self) -> FgColorDisplay<'_, owo_colors::colors::Cyan, Self> {
self.cyan()
}

#[inline(always)]
fn file_path_color(&self) -> FgColorDisplay<owo_colors::colors::Yellow, Self> {
fn file_path_color(&self) -> FgColorDisplay<'_, owo_colors::colors::Yellow, Self> {
self.yellow()
}

#[inline(always)]
fn dependency_id_color(&self) -> FgColorDisplay<owo_colors::colors::Blue, Self> {
fn dependency_id_color(&self) -> FgColorDisplay<'_, owo_colors::colors::Blue, Self> {
self.blue()
}

#[inline(always)]
fn version_id_color(&self) -> FgColorDisplay<owo_colors::colors::Blue, Self> {
fn version_id_color(&self) -> FgColorDisplay<'_, owo_colors::colors::Blue, Self> {
self.blue()
}

#[inline(always)]
fn dependency_version_color(&self) -> FgColorDisplay<owo_colors::colors::Magenta, Self> {
fn dependency_version_color(&self) -> FgColorDisplay<'_, owo_colors::colors::Magenta, Self> {
self.purple()
}

#[inline(always)]
fn alternate_dependency_version_color(
&self,
) -> FgColorDisplay<owo_colors::colors::Yellow, Self> {
) -> FgColorDisplay<'_, owo_colors::colors::Yellow, Self> {
self.yellow()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub fn get_ndk_str_versions_str(
manifest
.remote_package
.iter()
.filter(|&p| (p.path.starts_with("ndk;") && get_host_archive(p).is_some()))
.filter(|&p| p.path.starts_with("ndk;") && get_host_archive(p).is_some())
.map(|p| (p.path.split_once(';').unwrap().1, p))
.collect()
}
Expand Down
Loading