tangled
alpha
login
or
join now
vielle.dev
/
atcities.dev
8
fork
atom
[WIP] A (somewhat barebones) atproto app for creating custom sites without hosting!
8
fork
atom
overview
issues
pulls
pipelines
upload: check that directory is a directory
vielle.dev
5 months ago
97aab937
ccdf5e10
verified
This commit was signed with the committer's
known signature
.
vielle.dev
SSH Key Fingerprint:
SHA256:/4bvxqoEh9iMdjAPgcgAgXKZZQTROL3ULiPt6nH9RSs=
+13
-5
1 changed file
expand all
collapse all
unified
split
upload
src
config.rs
+13
-5
upload/src/config.rs
···
1
1
+
use std::fs;
2
2
+
1
3
pub struct Config {
2
4
pub user: String,
3
5
pub pword: String,
···
39
41
&& let Some(pword) = pword.clone()
40
42
&& let Some(dir) = dir.clone()
41
43
{
42
42
-
return Ok(Config {
43
43
-
user,
44
44
-
pword,
45
45
-
dir: dir.to_owned(),
46
46
-
});
44
44
+
if let Ok(metadata) = fs::metadata(dir.clone())
45
45
+
&& metadata.is_dir()
46
46
+
{
47
47
+
return Ok(Config {
48
48
+
user,
49
49
+
pword,
50
50
+
dir: dir.to_owned(),
51
51
+
});
52
52
+
} else {
53
53
+
return Err(ConfigErr::NotADirectory);
54
54
+
}
47
55
}
48
56
49
57
return Err(ConfigErr::NotEnoughArgs(String::from(