-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#4 lots of changes i cant even count omgomgomg
- Loading branch information
Showing
12 changed files
with
103 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::{collections, result}; | ||
|
||
use clap::error; | ||
|
||
use crate::backend::context::ProjectContext; | ||
|
||
/// Add a .jar from the filesystem to the dependencies. This will update the `espreso.toml` file. | ||
/// | ||
/// # Arguments | ||
/// * `path`: Reference to a string of the filesystem path to the .jar. For example, `/home/user/Downloads/artifact.jar`. | ||
/// * `name`: Reference to a string of the name of the dependency. For example, `lombok`. | ||
/// * `version`: Reference to a string of the version of the dependency. For example, `1.0.0`. | ||
/// * `p_ctx`: Reference to a `ProjectContext` struct | ||
/// | ||
/// # Returns | ||
/// Propagated `error:Error`(s) | ||
pub fn add(path: &String, name: &String, version: &String, p_ctx: &ProjectContext) -> result::Result<(), Box<dyn error::Error>> { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod manage; | ||
pub mod resolve; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/// Represents a resolved dependency | ||
pub struct ResolvedDependency { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod context; | ||
pub mod project; | ||
pub mod toolchain; | ||
pub mod lock; | ||
pub mod lock; | ||
pub mod dependency; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod directory; | ||
pub mod pathutil; | ||
pub mod net; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use std::error; | ||
|
||
use tokio::{fs::File, io::AsyncWriteExt}; | ||
|
||
/// Download a file from the internet. | ||
/// | ||
/// # Arguments | ||
/// * `url`: URL of the file | ||
/// * `path`: Filesystem path to the desired location | ||
/// | ||
/// # Returns | ||
/// Propagates any errors | ||
pub async fn download_file(url: &String, path: &String) -> Result<(), Box<dyn error::Error>> { | ||
let response = reqwest::get(url).await?; | ||
|
||
if response.status().is_success() { | ||
let body = response.bytes().await?; | ||
let mut file = File::create(path).await?; | ||
file.write_all(&body).await?; | ||
} | ||
Ok(()) | ||
} |