Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Commit aa9318a

Browse files
committed
toml/json fix
1 parent c469bad commit aa9318a

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

creeper.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
allow_delete = [
2+
'ServerScriptService',
3+
'ServerStorage',
4+
'ReplicatedStorage',
5+
'StarterPlayer',
6+
]
File renamed without changes.
File renamed without changes.

src/get.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ pub fn map_tree(tree: Vec<FileTree>) -> String {
3131

3232
for i in tree {
3333
if let FileTree::File(path, content) = i {
34-
let (name, _) = (
35-
path.file_stem().expect("Failed to get file_name").to_str().unwrap(),
34+
let (mut name, extension) = (
35+
path.file_stem().expect("Failed to get file_name").to_str().unwrap().to_string(),
3636
path.extension().expect("Failed to get extension!")
3737
);
3838

39-
file_structure.insert(format!("{name}"), content);
39+
if extension == "toml" || extension == "json" {
40+
name = format!("{name}.json");
41+
}
42+
file_structure.insert(name, content);
4043
} else if let FileTree::Directory(path, files) = i {
4144
let new_path = path.to_string_lossy();
4245
let game_index = new_path.find("game").unwrap();

src/post.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ pub async fn post(body: String) -> impl Responder {
1616
.body(
1717
map_tree(filesystem::get_game_files())
1818
)
19+
} else if data[0] == "__DELETED__" {
20+
println!("{} was just deleted!!!", data[1].to_string().red());
1921
}
20-
HttpResponse::Ok().body("Hello")
22+
HttpResponse::Ok().body("{Hello}")
2123
}

0 commit comments

Comments
 (0)