diff --git a/Cargo.toml b/Cargo.toml index fabacd361..4f15554ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,6 @@ +[workspace] +members = ["gawires-gist"] + [package] name = "gawires" version = "0.1.0" @@ -13,22 +16,21 @@ name = "gaw" path = "src/main.rs" [lib] -name = "gawireslib" +name = "gawires" path = "src/lib.rs" -crate-type = ["cdylib","rlib"] [dependencies] -notify = "5.0.0" -libloading = "0.7.4" -clap = {version = "4.0.32", features = ["derive"]} +notify = "6.1.1" +libloading = "0.8.3" +clap = {version = "4.5.7", features = ["derive"]} paw = "1.0.0" -interprocess = "1.2.1" -dirs = "4.0.0" -petgraph = "0.6.2" +interprocess = "2.2.0" +dirs = "5.0.1" +petgraph = "0.6.5" blake2 = "0.10.6" -uuid = "1.2.2" +uuid = "1.8.0" # Specific dependencies for the gawires kernel gawires-diff = { git = "https://github.com/metakernel/gawires-diff"} @@ -37,12 +39,12 @@ gawires-patch = { git = "https://github.com/metakernel/gawires-diff"} [target.'cfg(unix)'.dependencies] # Used for the filesystem in linux and macos -fuser = "0.12.0" +fuser = "0.14.0" [target.'cfg(windows)'.dependencies] # Used for the filesystem in windows dokan = "0.3.1+dokan206" -windows = "0.43.0" +windows = "0.57.0" [target.'cfg(windows)'.build-dependencies] -windows = "0.43.0" \ No newline at end of file +windows = "0.57.0" diff --git a/gawires-gist/Cargo.toml b/gawires-gist/Cargo.toml new file mode 100644 index 000000000..c325c6dac --- /dev/null +++ b/gawires-gist/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "gawires-gist" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/gawires-gist/src/main.rs b/gawires-gist/src/main.rs new file mode 100644 index 000000000..e7a11a969 --- /dev/null +++ b/gawires-gist/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/src/bin/central/main.rs b/src/bin/central/main.rs deleted file mode 100644 index 577a16a30..000000000 --- a/src/bin/central/main.rs +++ /dev/null @@ -1,9 +0,0 @@ -fn main() { - init(); -} - -fn init(){ - - println!("Normaly central server would be initializing now"); - -} \ No newline at end of file diff --git a/src/bin/gist/main.rs b/src/bin/gist/main.rs deleted file mode 100644 index 8a79a396d..000000000 --- a/src/bin/gist/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub fn main(){ - println!("Testing gist lib"); -} \ No newline at end of file diff --git a/src/bin/workspace_editor/main.rs b/src/bin/workspace_editor/main.rs deleted file mode 100644 index 60953a543..000000000 --- a/src/bin/workspace_editor/main.rs +++ /dev/null @@ -1,4 +0,0 @@ -/// Gawires Workspace Editor is a local application for managing all assets. It start a local web server where you can view and manage your local assets (tracking them, tagging them, creating new entities, etc.) + preview and download remote ones. -fn main(){ - println!("starting assets station"); -} \ No newline at end of file diff --git a/src/cli/commands.rs b/src/cli/commands.rs index 3f2879cd1..787e7aa2f 100644 --- a/src/cli/commands.rs +++ b/src/cli/commands.rs @@ -26,17 +26,17 @@ use clap::{Parser,Subcommand}; Rebase(Rebase), // Rebase a workspace branch on another branch Merge(Merge), // Merge a workspace branch on another branch Clean(Clean), // Clean the workspace - Project(Project), + Project(Project), Install(Install), Uninstall(Uninstall), Asset(Asset), } - ///track new assets or changes, add tags and other operations. + ///track new file, add tags and other operations. #[derive(Debug, PartialEq, Parser)] pub struct Add{ - /// Stage assets changes in a given path + /// Tracks new file pub path: Option, /// Stage all changes in workspace that are not ignored #[arg(short = 'a', long = "all")] @@ -47,7 +47,7 @@ use clap::{Parser,Subcommand}; /// Add a tag to the assets with the given name #[arg(name = "Tag name",short = 't', long = "tag")] - pub tag_name: Option, + pub tag_name: Option>, } /// Checkout assets in local workspace from a source like . When assets are checkout, they are locked by default when in centralized mode. @@ -66,7 +66,7 @@ use clap::{Parser,Subcommand}; #[derive(Debug, PartialEq, Parser)] pub struct Release{ } - /// Initialize a new local workspace that can be connected to a central workspace + /// Initialize a new local workspace that can be connected to a project #[derive(Debug, PartialEq, Parser)] pub struct Init{ } diff --git a/src/core/config/user_config.rs b/src/core/config/user_config.rs index 685e96585..67fb7383a 100644 --- a/src/core/config/user_config.rs +++ b/src/core/config/user_config.rs @@ -41,7 +41,7 @@ impl UserConfig{ /// Get the configuration root path. pub fn get_gawires_configs_root() -> PathBuf { - home_dir().unwrap().join(".gawires/") + home_dir().unwrap().join(".gaw/") } // Get the user configuration default path. diff --git a/src/core/diff/difftree.rs b/src/core/diff/difftree.rs index 753d1270f..eab0ffdd4 100644 --- a/src/core/diff/difftree.rs +++ b/src/core/diff/difftree.rs @@ -1,7 +1,41 @@ use crate::core::tree::ArenaTree; use crate::core::diff::Diff; +use std::cell::RefCell; +use std::process::Child; +use std::rc::Rc; + +type DiffTreeNode = Rc>; struct DiffTree{ internal_structure: ArenaTree, - parent: Box>, + parent: Option, + children: Vec, +} + +impl DiffTree{ + + pub fn new(internal_structure: ArenaTree) -> DiffTreeNode{ + Rc::new(RefCell::new(DiffTree { + internal_structure, + parent: None, + children: Vec::new(), + } + ))} + + pub fn add_child(parent: &DiffTreeNode, internal_structure: ArenaTree) -> DiffTreeNode{ + let child = DiffTree::new(internal_structure); + child.borrow_mut().parent = Some(Rc::clone(parent)); + parent.borrow_mut().children.push(Rc::clone(&child)); + + child + } + + pub fn display(node: &DiffTreeNode, depth: usize){ + let indent = " ".repeat(depth*2); + println!("{}Node: {:?}",indent,node.borrow().internal_structure); + + for child in &node.borrow().children { + DiffTree::display(child, depth + 1); + } + } } \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 0a3aa9297..73b06b09c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,3 @@ -#![feature(const_option)] - mod cli; use paw::Args; pub use clap::Parser;