This commit is contained in:
Kreyren 2020-01-20 05:21:25 +00:00
parent 3e5b93a629
commit c03c7e39c2
4 changed files with 7 additions and 5 deletions

2
.github/README.md vendored
View File

@ -1,3 +1,5 @@
**NOTICE:** This project in in "init phase" so everything will be remade into a new orphen branch once methods for quality assurance, documentation, automatization and code is decided to be used as a foundation for new commits
fixme: Source the header in different markdown file to make GitHub README different from GitLab
fixme: Change the name based on repository used

View File

@ -8,7 +8,6 @@ use clap::{Arg, App, SubCommand};
/// FIXME: Verify unused
use std::fs;
// Export of standard library to make a new directory (works cross-platform)
/// FIXME: Make create_dir to output TRACE message of level 2
/// FIXME: Output helpful error in CLI and logs
@ -76,8 +75,8 @@ fn emkdir<PATH: AsRef<std::path::Path>>(pathname: PATH) {
// FIXME-TEST: Make sure that this works on MacOS
// FIXME-TEST: Make sure that this works on FreeBSD
// FIXME: Implement permission management for new directory
fixme!("die() doesn't accept pathname println!();-way, using some/path as stub");
if metadata(pathname.as_ref()).unwrap().is_dir() {
fixme!("die() doesn't accept pathname println-way, using some/path as stub");
if !metadata(pathname.as_ref()).unwrap().is_dir() {
match fs::create_dir(pathname.as_ref()) {
Ok(..) => { trace!("Created a new directory in some/path"); },
Err(ref error) if error.kind() == io::ErrorKind::AlreadyExists => {
@ -92,10 +91,10 @@ fn emkdir<PATH: AsRef<std::path::Path>>(pathname: PATH) {
die!(256; "Unexpected happend for creation of some/path after sanity checks and prior to create_dir() call");
}
},
Err(e) => { die!(256; "Unexpected happend while creating a directory some/path"); }
Err(error) => { die!(256; "Unexpected happend while creating a directory some/path"); }
}
} else if metadata(pathname.as_ref()).unwrap().is_dir() {
info!("Directory {} already exists");
trace!("Directory some/path already exists no need to create it");
} else if metadata(pathname.as_ref()).unwrap().is_file() {
// FIXME: die!(1; "Path {} is already a file which is unexpected", pathname);
die!(1; "Path somepath is already a file which is unexpected");
@ -157,6 +156,7 @@ fn main() {
// FIXME-TEST: Make a test to ensure that features are not escaping sandbox
// FIXME: Translate in rustlang from english
fixme!("Create a new directory in tmpdir/name-of-project");
emkdir("/var/tmp/RXT0112");
fixme!("Create sandboxed environment for testing of features");
unimplemented!("Development method is not yet supported");
}