Conversation
|
Are you aware of JuliaLang/Pkg.jl#3772? I think this would be good to coordinate with that PR so we don't have two completely separate notions of apps in the Julia ecosystem |
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
rustfmt
[rustfmt] reported by reviewdog 🐶
juliaup/src/command_app_run.rs
Line 31 in 0fc1554
[rustfmt] reported by reviewdog 🐶
juliaup/src/command_app_run.rs
Line 34 in 0fc1554
[rustfmt] reported by reviewdog 🐶
juliaup/src/command_app_run.rs
Line 37 in 0fc1554
[rustfmt] reported by reviewdog 🐶
juliaup/src/command_app_run.rs
Lines 48 to 50 in 0fc1554
[rustfmt] reported by reviewdog 🐶
juliaup/src/command_app_run.rs
Line 53 in 0fc1554
[rustfmt] reported by reviewdog 🐶
Line 59 in 0fc1554
[rustfmt] reported by reviewdog 🐶
Line 73 in 0fc1554
[rustfmt] reported by reviewdog 🐶
Line 7 in 0fc1554
[rustfmt] reported by reviewdog 🐶
Line 9 in 0fc1554
[rustfmt] reported by reviewdog 🐶
Lines 229 to 233 in 0fc1554
[rustfmt] reported by reviewdog 🐶
Line 239 in 0fc1554
[rustfmt] reported by reviewdog 🐶
Lines 246 to 250 in 0fc1554
[rustfmt] reported by reviewdog 🐶
Lines 280 to 281 in 0fc1554
[rustfmt] reported by reviewdog 🐶
Line 283 in 0fc1554
[rustfmt] reported by reviewdog 🐶
Line 285 in 0fc1554
[rustfmt] reported by reviewdog 🐶
Lines 833 to 834 in 0fc1554
| use juliaup::cli::{ApplicationSubCmd, ConfigSubCmd, Juliaup, OverrideSubCmd, SelfSubCmd}; | ||
| use juliaup::command_api::run_command_api; | ||
| use juliaup::command_app_add::run_command_app_add; | ||
| use juliaup::command_app_run::run_command_app_run; |
There was a problem hiding this comment.
[rustfmt] reported by reviewdog 🐶
| use juliaup::command_app_run::run_command_app_run; |
| use juliaup::command_app_add::run_command_app_add; | ||
| use juliaup::command_app_run::run_command_app_run; | ||
| use juliaup::command_app_remove::run_command_app_remove; | ||
| use juliaup::command_completions::run_command_completions; |
There was a problem hiding this comment.
[rustfmt] reported by reviewdog 🐶
| use juliaup::command_completions::run_command_completions; | |
| use juliaup::command_app_run::run_command_app_run; | |
| use juliaup::command_completions::run_command_completions; |
| ApplicationSubCmd::Add { value } => { | ||
| run_command_app_add(&value, &paths) | ||
| }, | ||
| ApplicationSubCmd::Run { name, args } => { | ||
| run_command_app_run(&name, &args, &paths) | ||
| }, | ||
| ApplicationSubCmd::Remove { name } => run_command_app_remove(&name, &paths) |
There was a problem hiding this comment.
[rustfmt] reported by reviewdog 🐶
| ApplicationSubCmd::Add { value } => { | |
| run_command_app_add(&value, &paths) | |
| }, | |
| ApplicationSubCmd::Run { name, args } => { | |
| run_command_app_run(&name, &args, &paths) | |
| }, | |
| ApplicationSubCmd::Remove { name } => run_command_app_remove(&name, &paths) | |
| ApplicationSubCmd::Add { value } => run_command_app_add(&value, &paths), | |
| ApplicationSubCmd::Run { name, args } => run_command_app_run(&name, &args, &paths), | |
| ApplicationSubCmd::Remove { name } => run_command_app_remove(&name, &paths), |
| Add { | ||
| value: String | ||
| }, |
There was a problem hiding this comment.
[rustfmt] reported by reviewdog 🐶
| Add { | |
| value: String | |
| }, | |
| Add { value: String }, |
| Run { | ||
| name: String, | ||
| args: Vec<String> | ||
| }, |
There was a problem hiding this comment.
[rustfmt] reported by reviewdog 🐶
| Run { | |
| name: String, | |
| args: Vec<String> | |
| }, | |
| Run { name: String, args: Vec<String> }, |
| use crate::{config_file::{load_config_db, JuliaupConfigApplication}, global_paths::GlobalPaths}; | ||
| use anyhow::{Context,Result}; |
There was a problem hiding this comment.
[rustfmt] reported by reviewdog 🐶
| use crate::{config_file::{load_config_db, JuliaupConfigApplication}, global_paths::GlobalPaths}; | |
| use anyhow::{Context,Result}; | |
| use crate::{ | |
| config_file::{load_config_db, JuliaupConfigApplication}, | |
| global_paths::GlobalPaths, | |
| }; | |
| use anyhow::{Context, Result}; |
| use normpath::PathExt; | ||
|
|
||
| pub fn run_command_app_run(name: &str, args: &Vec<String>, paths: &GlobalPaths) -> Result<()> { | ||
|
|
There was a problem hiding this comment.
[rustfmt] reported by reviewdog 🐶
| let config_file = load_config_db(paths) | ||
| .with_context(|| "`app run` command failed to load configuration data.")?; | ||
|
|
||
| let target: HashMap<String,(String,String,String,String)> = config_file |
There was a problem hiding this comment.
[rustfmt] reported by reviewdog 🐶
| let target: HashMap<String,(String,String,String,String)> = config_file | |
| let target: HashMap<String, (String, String, String, String)> = config_file |
| .flat_map(|i| match&i.1 { | ||
| JuliaupConfigApplication::DevedApplication { path, julia_version, julia_depot, execution_aliases } => execution_aliases.iter().map(|j| (j.0.clone(), (j.1.target.clone(), path.clone(), julia_version.clone(), julia_depot.clone()))) |
There was a problem hiding this comment.
[rustfmt] reported by reviewdog 🐶
| .flat_map(|i| match&i.1 { | |
| JuliaupConfigApplication::DevedApplication { path, julia_version, julia_depot, execution_aliases } => execution_aliases.iter().map(|j| (j.0.clone(), (j.1.target.clone(), path.clone(), julia_version.clone(), julia_depot.clone()))) | |
| .flat_map(|i| match &i.1 { | |
| JuliaupConfigApplication::DevedApplication { | |
| path, | |
| julia_version, | |
| julia_depot, | |
| execution_aliases, | |
| } => execution_aliases.iter().map(|j| { | |
| ( | |
| j.0.clone(), | |
| ( | |
| j.1.target.clone(), | |
| path.clone(), | |
| julia_version.clone(), | |
| julia_depot.clone(), | |
| ), | |
| ) | |
| }), | |
| }) | |
| .map(|i| { | |
| ( | |
| i.0.clone(), | |
| ( | |
| i.1 .0.clone(), | |
| i.1 .1.clone(), | |
| i.1 .2.clone(), | |
| i.1 .3.clone(), | |
| ), | |
| ) |
| .flat_map(|i| match&i.1 { | ||
| JuliaupConfigApplication::DevedApplication { path, julia_version, julia_depot, execution_aliases } => execution_aliases.iter().map(|j| (j.0.clone(), (j.1.target.clone(), path.clone(), julia_version.clone(), julia_depot.clone()))) | ||
| }) | ||
| .map(|i| (i.0.clone(), (i.1.0.clone(), i.1.1.clone(), i.1.2.clone(), i.1.3.clone()))) |
There was a problem hiding this comment.
[rustfmt] reported by reviewdog 🐶
| .map(|i| (i.0.clone(), (i.1.0.clone(), i.1.1.clone(), i.1.2.clone(), i.1.3.clone()))) |
More a proof of concept at the moment.
Definition of an app looks like https://github.com/davidanthoff/examplejlapp.
To add an app:
To run the app:
To remove the app:
Lots and lots of things that would need to be added:
appcommands should actually have their own app, likejlapp add ...