Skip to content

Commit

Permalink
chores: moved dive to bin directory
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelcoeffic committed Nov 9, 2024
1 parent 3e9c4a2 commit 18bd2d9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
20 changes: 5 additions & 15 deletions src/main.rs → src/bin/dive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,11 @@ use rustix::{
runtime::{fork, Fork},
};

mod base_image;
mod namespaces;
mod overlay;
mod pid_file;
mod pid_lookup;
mod shared_mount;

#[cfg(feature = "embedded_image")]
mod embedded_image;

use base_image::*;
use namespaces::*;
use overlay::*;
use pid_lookup::*;
use shared_mount::*;
use dive::base_image::*;
use dive::namespaces::*;
use dive::overlay::*;
use dive::pid_lookup::*;
use dive::shared_mount::*;

const APP_NAME: &str = "dive";
const IMG_DIR: &str = "base-img";
Expand Down
2 changes: 1 addition & 1 deletion src/embedded_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use anyhow::Result;
use image_builder::progress_bar;
use liblzma::read::XzDecoder;

use crate::install_base_image_from_reader;
use crate::base_image::install_base_image_from_reader;

pub fn install_base_image<P>(dest: P) -> Result<()>
where
Expand Down
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pub mod base_image;
pub mod namespaces;
pub mod overlay;
pub mod pid_lookup;
pub mod shared_mount;

#[cfg(feature = "embedded_image")]
mod embedded_image;

mod pid_file;
2 changes: 1 addition & 1 deletion src/pid_lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const _RUNTIMES: &[ContainerRuntime] = &[
},
];

pub(crate) fn pid_lookup(value: &str) -> Option<i32> {
pub fn pid_lookup(value: &str) -> Option<i32> {
if let Ok(pid) = value.parse::<i32>() {
return Some(pid);
};
Expand Down
3 changes: 2 additions & 1 deletion src/shared_mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ use rustix::{
},
};

use crate::{pid_file::PidFile, OverlayBuilder, OverlayMount};
use crate::overlay::{OverlayBuilder, OverlayMount};
use crate::pid_file::PidFile;

pub struct SharedMount {
_pid_file: PidFile,
Expand Down

0 comments on commit 18bd2d9

Please sign in to comment.