Skip to content

Commit 09dd740

Browse files
authored
解决解压在线下载的targz失败的问题 (#12)
1 parent b2f4e7c commit 09dd740

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/executor/source.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ impl GitSource {
226226
cmd.current_dir(&target_dir.path);
227227
cmd.arg("fetch").arg("--unshallow");
228228

229-
// 安静模式
230-
cmd.arg("-f").arg("-q");
229+
cmd.arg("-f");
231230

232231
// 创建子进程,执行命令
233232
let proc: std::process::Child = cmd
@@ -429,6 +428,7 @@ pub struct ArchiveFile {
429428

430429
impl ArchiveFile {
431430
pub fn new(archive_path: &PathBuf) -> Self {
431+
info!("archive_path: {:?}", archive_path);
432432
//匹配压缩文件类型
433433
let archive_name = archive_path.file_name().unwrap().to_str().unwrap();
434434
for (regex, archivetype) in [
@@ -473,9 +473,10 @@ impl ArchiveFile {
473473
//根据压缩文件的类型生成cmd指令
474474
match &self.archive_type {
475475
ArchiveType::TarGz => {
476-
let mut cmd = Command::new("tar -xzf");
477-
cmd.arg(&self.archive_name);
476+
let mut cmd = Command::new("tar");
477+
cmd.arg("-xzf").arg(&self.archive_name);
478478
let proc: std::process::Child = cmd
479+
.current_dir(path)
479480
.stderr(Stdio::piped())
480481
.stdout(Stdio::inherit())
481482
.spawn()

0 commit comments

Comments
 (0)