Add --include-fonts flag for archive (#277)

This commit is contained in:
bytedream 2023-12-19 22:37:16 +01:00
parent 0a26083232
commit 0da81a4814
4 changed files with 228 additions and 7 deletions

View file

@ -6,7 +6,7 @@ use std::path::{Path, PathBuf};
use std::pin::Pin;
use std::process::{Command, Stdio};
use std::task::{Context, Poll};
use std::{env, io};
use std::{env, fs, io};
use tempfile::{Builder, NamedTempFile};
use tokio::io::{AsyncRead, ReadBuf};
@ -46,6 +46,12 @@ pub fn tempfile<S: AsRef<str>>(suffix: S) -> io::Result<NamedTempFile> {
Ok(tempfile)
}
pub fn cache_dir<S: AsRef<str>>(name: S) -> io::Result<PathBuf> {
let cache_dir = temp_directory().join(format!(".crunchy-cli_{}_cache", name.as_ref()));
fs::create_dir_all(&cache_dir)?;
Ok(cache_dir)
}
pub struct TempNamedPipe {
name: String,