Skip to content

Commit

Permalink
fix: some bugs with vfox
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Oct 14, 2024
1 parent f3b0e33 commit 0c90062
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ url = "2.5.0"
usage-lib = { version = "0.10", features = ["clap", "docs"] }
versions = { version = "6.2.0", features = ["serde"] }
vfox = "0.1"
# vfox = {path="../vfox.rs"}
walkdir = "2.5.0"
which = "6"
xx = { version = "1.0.0", features = ["glob"] }
Expand Down
4 changes: 2 additions & 2 deletions docs/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ editLink: false
| calendarsync | [asdf:FeryET/asdf-calendarsync](https://github.com/FeryET/asdf-calendarsync) |
| calicoctl | [asdf:TheCubicleJockey/asdf-calicoctl](https://github.com/TheCubicleJockey/asdf-calicoctl) |
| camunda-modeler | [asdf:barmac/asdf-camunda-modeler](https://github.com/barmac/asdf-camunda-modeler) |
| cargo-binstall | [cargo:cargo-binstall](https://crates.io/crates/cargo-binstall) |
| cargo-binstall | [ubi:cargo-bins/cargo-binstall](https://github.com/cargo-bins/cargo-binstall) |
| cargo-make | [asdf:mise-plugins/asdf-cargo-make](https://github.com/mise-plugins/asdf-cargo-make) |
| carp | [asdf:susurri/asdf-carp](https://github.com/susurri/asdf-carp) |
| carthage | [asdf:younke/asdf-carthage](https://github.com/younke/asdf-carthage) |
Expand Down Expand Up @@ -245,7 +245,7 @@ editLink: false
| gcc-arm-none-eabi | [asdf:dlech/asdf-gcc-arm-none-eabi](https://github.com/dlech/asdf-gcc-arm-none-eabi) |
| gcloud | [asdf:jthegedus/asdf-gcloud](https://github.com/jthegedus/asdf-gcloud) |
| getenvoy | [asdf:asdf-community/asdf-getenvoy](https://github.com/asdf-community/asdf-getenvoy) |
| gh | [asdf:bartlomiejdanek/asdf-github-cli](https://github.com/bartlomiejdanek/asdf-github-cli) |
| gh | [ubi:cli/cli](https://github.com/cli/cli) |
| ghc | [asdf:sestrella/asdf-ghcup](https://github.com/sestrella/asdf-ghcup) |
| ghidra | [asdf:Honeypot95/asdf-ghidra](https://github.com/Honeypot95/asdf-ghidra) |
| ghorg | [asdf:gbloquel/asdf-ghorg](https://github.com/gbloquel/asdf-ghorg) |
Expand Down
12 changes: 8 additions & 4 deletions registry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ cyclonedx = ["asdf:xeedio/asdf-cyclonedx"]
dagger = ["asdf:virtualstaticvoid/asdf-dagger"]
danger-js = ["asdf:MontakOleg/asdf-danger-js"]
dapr = ["asdf:asdf-community/asdf-dapr-cli"]
dart = ["vfox:version-fox/vfox-dart", "asdf:PatOConnor43/asdf-dart"]
# dart = ["vfox:version-fox/vfox-dart", "asdf:PatOConnor43/asdf-dart"] # TODO: vfox has issues on arm64
dart = ["asdf:PatOConnor43/asdf-dart"]
dasel = ["asdf:asdf-community/asdf-dasel"]
datree = ["asdf:lukeab/asdf-datree"]
daytona = ["asdf:CrouchingMuppet/asdf-daytona"]
Expand Down Expand Up @@ -208,7 +209,8 @@ editorconfig-checker = ["asdf:gabitchov/asdf-editorconfig-checker"]
ejson = ["asdf:cipherstash/asdf-ejson"]
eksctl = ["asdf:elementalvoid/asdf-eksctl"]
elasticsearch = ["asdf:asdf-community/asdf-elasticsearch"]
elixir = ["vfox:version-fox/vfox-elixir", "asdf:mise-plugins/mise-elixir"]
# elixir = ["vfox:version-fox/vfox-elixir", "asdf:mise-plugins/mise-elixir"] # TODO: not sure what is wrong with this one
elixir = [ "asdf:mise-plugins/mise-elixir"]
elixir-ls = ["asdf:juantascon/asdf-elixir-ls"]
elm = ["asdf:asdf-community/asdf-elm"]
embulk = ["asdf:yuokada/asdf-embulk"]
Expand Down Expand Up @@ -385,7 +387,8 @@ ko = ["asdf:zasdaym/asdf-ko"]
koka = ["asdf:susurri/asdf-koka"]
kompose = ["asdf:technikhil314/asdf-kompose"]
kops = ["asdf:Antiarchitect/asdf-kops"]
kotlin = ["vfox:version-fox/vfox-kotlin", "asdf:asdf-community/asdf-kotlin"]
# kotlin = ["vfox:version-fox/vfox-kotlin", "asdf:asdf-community/asdf-kotlin"] # TODO: needs html extension for vfox.rs
kotlin = ["asdf:asdf-community/asdf-kotlin"]
kp = ["asdf:vmware-tanzu/tanzu-plug-in-for-asdf"]
kpack = ["asdf:asdf-community/asdf-kpack-cli"]
kpt = ["asdf:nlamirault/asdf-kpt"]
Expand Down Expand Up @@ -461,7 +464,8 @@ mark = ["asdf:jfreeland/asdf-mark"]
markdownlint-cli2 = ["asdf:paulo-ferraz-oliveira/asdf-markdownlint-cli2"]
marp-cli = ["asdf:xataz/asdf-marp-cli"]
mask = ["asdf:aaaaninja/asdf-mask"]
maven = ["vfox:version-fox/vfox-maven", "asdf:mise-plugins/asdf-maven"]
# maven = ["vfox:version-fox/vfox-maven", "asdf:mise-plugins/asdf-maven"] # TODO: needs html extension for vfox.rs
maven = ["asdf:mise-plugins/asdf-maven"]
mc = ["asdf:penpyt/asdf-mc"]
mdbook = ["asdf:cipherstash/asdf-mdbook"]
mdbook-linkcheck = ["asdf:cipherstash/asdf-mdbook-linkcheck"]
Expand Down
6 changes: 5 additions & 1 deletion scripts/render-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ process.env.MISE_VFOX = 0;
const stdout = execSync("mise registry", { encoding: "utf-8" });
// Regular expression to match plugin name and repository URL
// e.g.: zprint asdf:carlduevel/asdf-zprint
const regex = /^(.+?) +(.+?):(.+?) *$/gm;
const regex = /^(.+?) +(.+?):(.+?)(\[.+\])? *$/gm;

let match;
let output = ["---\neditLink: false\n---"];
Expand Down Expand Up @@ -38,6 +38,10 @@ while ((match = regex.exec(stdout)) !== null) {
output.push(
`| ${match[1]} | [${match[2]}:${match[3]}](https://pypi.org/project/${match[3]}) |`,
);
} else if (match[2] === "ubi") {
output.push(
`| ${match[1]} | [${match[2]}:${match[3]}](https://github.com/${match[3]}) |`,
);
} else {
output.push(`| ${match[1]} | ${match[2]}:${match[3]} |`);
}
Expand Down
4 changes: 2 additions & 2 deletions src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ fn load_tools() -> BackendMap {
let mut vfox_tools = Ok(vec![]);
let mut backend_tools = Ok(vec![]);
rayon::scope(|s| {
if !cfg!(windows) || !SETTINGS.disable_backends.contains(&"asdf".to_string()) {
if !SETTINGS.disable_backends.contains(&"asdf".to_string()) {
s.spawn(|_| asdf_tools = asdf::AsdfBackend::list());
}
if cfg!(windows) || !SETTINGS.disable_backends.contains(&"vfox".to_string()) {
if !SETTINGS.disable_backends.contains(&"vfox".to_string()) {
s.spawn(|_| vfox_tools = vfox::VfoxBackend::list());
}
backend_tools = list_installed_backends();
Expand Down
4 changes: 1 addition & 3 deletions src/backend/vfox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use url::Url;
use crate::backend::{ABackend, Backend, BackendList, BackendType};
use crate::cache::{CacheManager, CacheManagerBuilder};
use crate::cli::args::BackendArg;
use crate::config::{Config, Settings, SETTINGS};
use crate::config::{Config, SETTINGS};
use crate::git::Git;
use crate::install_context::InstallContext;
use crate::plugins::PluginType;
Expand Down Expand Up @@ -62,8 +62,6 @@ impl Backend for VfoxBackend {
}

fn install_version_impl(&self, ctx: &InstallContext) -> eyre::Result<()> {
let settings = Settings::get();
settings.ensure_experimental("vfox backend")?;
self.ensure_plugin_installed()?;
self.runtime()?.block_on(self.vfox.install(
&self.pathname,
Expand Down
4 changes: 1 addition & 3 deletions src/cli/settings/ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ mod tests {
asdf_compat = false
cache_prune_age = "0"
color = true
disable_backends = ["vfox"]
disable_backends = []
disable_default_registry = false
disable_hints = []
disable_tools = []
Expand Down Expand Up @@ -94,7 +94,6 @@ mod tests {
trusted_config_paths = []
use_versions_host = true
verbose = true
vfox = false
yes = true
[cargo]
Expand Down Expand Up @@ -182,7 +181,6 @@ mod tests {
trusted_config_paths
use_versions_host
verbose
vfox
yes
"#);
}
Expand Down
3 changes: 1 addition & 2 deletions src/cli/settings/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub mod tests {
asdf_compat = false
cache_prune_age = "0"
color = true
disable_backends = ["vfox"]
disable_backends = []
disable_default_registry = false
disable_hints = []
disable_tools = []
Expand Down Expand Up @@ -160,7 +160,6 @@ pub mod tests {
trusted_config_paths = []
use_versions_host = true
verbose = true
vfox = false
yes = true
[cargo]
Expand Down
3 changes: 1 addition & 2 deletions src/cli/settings/unset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ mod tests {
asdf_compat = false
cache_prune_age = "0"
color = true
disable_backends = ["vfox"]
disable_backends = []
disable_default_registry = false
disable_hints = []
disable_tools = []
Expand Down Expand Up @@ -85,7 +85,6 @@ mod tests {
trusted_config_paths = []
use_versions_host = true
verbose = true
vfox = false
yes = true
[cargo]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ expression: "replace_path(&format!(\"{:#?}\", cf.to_tool_request_set().unwrap())
---
ToolRequestSet {
tools: {
BackendArg("terraform"): [
BackendArg("terraform" -> "vfox:enochchau/vfox-terraform"): [
Version {
backend: BackendArg("terraform"),
backend: BackendArg("terraform" -> "vfox:enochchau/vfox-terraform"),
version: "1.0.0",
options: {},
},
Expand Down Expand Up @@ -75,7 +75,7 @@ ToolRequestSet {
BackendArg("shellcheck"): MiseToml(
"~/fixtures/.mise.toml",
),
BackendArg("terraform"): MiseToml(
BackendArg("terraform" -> "vfox:enochchau/vfox-terraform"): MiseToml(
"~/fixtures/.mise.toml",
),
},
Expand Down
1 change: 0 additions & 1 deletion src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ include!(concat!(env!("OUT_DIR"), "/registry.rs"));
pub static REGISTRY: Lazy<BTreeMap<&str, String>> = Lazy::new(|| {
let backend_types = vec!["ubi", "vfox", "asdf", "cargo", "go", "npm", "pipx", "spm"]
.into_iter()
.filter(|b| cfg!(windows) || SETTINGS.vfox == Some(true) || *b != "ubi")
.filter(|b| !SETTINGS.disable_backends.contains(&b.to_string()))
.collect::<HashSet<_>>();

Expand Down
1 change: 0 additions & 1 deletion src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ pub fn reset() {
indoc! {r#"
experimental = true
verbose = true
vfox = false
"#},
)
.unwrap();
Expand Down
1 change: 0 additions & 1 deletion test/config/settings.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
experimental = true
verbose = true
vfox = false

0 comments on commit 0c90062

Please sign in to comment.