Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tmc-langs-cli/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ pub fn create_app() -> App<'static, 'static> {

.subcommand(create_core_app()) // "core"

/*
.subcommand(
SubCommand::with_name("disk-space")
.about("Returns the amount of free disk space in megabytes left on the partition that contains the given path")
Expand All @@ -77,6 +78,7 @@ pub fn create_app() -> App<'static, 'static> {
.required(true)
.takes_value(true))
)
*/

.subcommand(SubCommand::with_name("extract-project")
.about("Extracts an exercise from a ZIP archive. If the output-path is a project root, the plugin's student file policy will be used to avoid overwriting student files")
Expand Down Expand Up @@ -775,7 +777,7 @@ mod base_test {
]);
}

#[test]
// #[test]
fn disk_space() {
get_matches(&["disk-space", "--path", "path"]);
}
Expand Down
2 changes: 2 additions & 0 deletions tmc-langs-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ fn run_app(matches: ArgMatches, pretty: bool) -> Result<()> {
}
}
}
/*
("disk-space", Some(matches)) => {
let path = matches.value_of("path").unwrap();
let path = Path::new(path);
Expand All @@ -297,6 +298,7 @@ fn run_app(matches: ArgMatches, pretty: bool) -> Result<()> {
);
print_output(&output, pretty)?
}
*/
("extract-project", Some(matches)) => {
let archive_path = matches.value_of("archive-path").unwrap();
let archive_path = Path::new(archive_path);
Expand Down
2 changes: 1 addition & 1 deletion tmc-langs-cli/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub enum Data {
},
Validation(StyleValidationResult),
/// megabytes
FreeDiskSpace(u64),
// FreeDiskSpace(u64),
AvailablePoints(Vec<String>),
Exercises(Vec<PathBuf>),
ExercisePackagingConfiguration(ExercisePackagingConfiguration),
Expand Down
2 changes: 1 addition & 1 deletion tmc-langs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tmc-langs-util = { path = "../tmc-langs-util" }

base64 = "0.13"
dirs = "3"
heim = { version = "0.1.0-beta.3", features = ["disk"] }
# heim = { version = "0.1.0-beta.3", features = ["disk"] }
impl-enum = "0.2"
log = "0.4"
lazy_static = "1"
Expand Down
4 changes: 2 additions & 2 deletions tmc-langs/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ pub enum LangsError {
Plugin(#[from] tmc_langs_plugins::PluginError),
#[error(transparent)]
FileError(#[from] tmc_langs_util::FileError),
#[error(transparent)]
Heim(#[from] heim::Error),
// #[error(transparent)]
// Heim(#[from] heim::Error),
#[error(transparent)]
WalkDir(#[from] walkdir::Error),
#[error(transparent)]
Expand Down
4 changes: 3 additions & 1 deletion tmc-langs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub use tmc_langs_util::{

use crate::config::ProjectsConfig;
use crate::data::DownloadTarget;
use heim::disk;
// use heim::disk;
use oauth2::{
basic::BasicTokenType, AccessToken, EmptyExtraTokenFields, Scope, StandardTokenResponse,
};
Expand Down Expand Up @@ -666,6 +666,7 @@ pub fn compress_project_to(source: &Path, target: &Path) -> Result<(), LangsErro
Ok(())
}

/*
/// Checks how many megabytes are available on the disk containing the target path.
pub fn free_disk_space_megabytes(path: &Path) -> Result<u64, LangsError> {
log::debug!("checking disk usage in {}", path.display());
Expand All @@ -675,6 +676,7 @@ pub fn free_disk_space_megabytes(path: &Path) -> Result<u64, LangsError> {
.get::<heim::units::information::megabyte>();
Ok(usage)
}
*/

/// Extracts the compressed project to the target location.
pub fn extract_project(
Expand Down