Skip to content

Commit 5024869

Browse files
committed
feat: add chunks for servers
This assumes server hosts allow symlinks to be resolved. Not doing that is a mistake now, perhaps we need a better solution than symlinking.
1 parent c582001 commit 5024869

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/commands/repo.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use anyhow::{Result, anyhow};
22
use comfy_table::Table;
3-
use std::{fs, path::Path};
3+
use std::{fs, os::unix::fs::symlink, path::Path};
44

55
use crate::{
66
RepoCommands,
@@ -9,9 +9,18 @@ use crate::{
99
utils::resolve_repo,
1010
};
1111

12-
pub async fn repo_commands(path: &Path, chunks_path: &Path, command: RepoCommands) -> Result<()> {
12+
pub async fn repo_commands(
13+
path: &Path,
14+
chunk_store_path: &Path,
15+
command: RepoCommands,
16+
) -> Result<()> {
1317
match command {
14-
RepoCommands::Create { repo_name } => repo::create(&path.join(&repo_name), None)?,
18+
RepoCommands::Create { repo_name } => {
19+
let repo_path = &path.join(&repo_name);
20+
21+
repo::create(repo_path, None)?;
22+
symlink(Path::new("../../chunks"), repo_path.join("chunks"))?;
23+
}
1524

1625
RepoCommands::List => {
1726
let mut table = Table::new();

0 commit comments

Comments
 (0)