Explorar el Código

[publish] FileZip 1.6

lith hace 3 años
padre
commit
77b910a184

+ 9 - 8
FileZip/Cmd/Unzip.cs

@@ -9,7 +9,7 @@ namespace FileZip.Cmd
 
 
         #region unzip
-        
+
         [Command("unzip")]
         [Remarks("解压zip文件。若为分卷(后缀为数字 如.001)则先合并文件再解压")]
         [Remarks("支持格式: zip,gz,bzip2,tar,rar,lzip,xz,7zip,7z")]
@@ -38,13 +38,14 @@ namespace FileZip.Cmd
             Directory.CreateDirectory(output);
 
             float? progress = null;
-            string strProgress = ConsoleHelp.GetArg(args, "-o") ?? ConsoleHelp.GetArg(args, "--output");
+            string strProgress = ConsoleHelp.GetArg(args, "-p") ?? ConsoleHelp.GetArg(args, "--progress");
             if (strProgress == "")
             {
                 progress = 0.1f;
-            } else if (strProgress != null) 
+            }
+            else if (strProgress != null)
             {
-                if (float.TryParse(strProgress, out var pro) && pro>0 & pro<=1) 
+                if (float.TryParse(strProgress, out var pro) && pro > 0 & pro <= 1)
                 {
                     progress = pro;
                 }
@@ -92,11 +93,11 @@ namespace FileZip.Cmd
                     inputPath = input,
                     outputPath = output
                 };
-                
 
-                if (printFile) 
+
+                if (printFile)
                 {
-                    unpack.OnFile = (int sumCount, int curCount, string fileName) => ConsoleHelp.Log($"[{ curCount }/{sumCount} f]  " + fileName); 
+                    unpack.OnFile = (int sumCount, int curCount, string fileName) => ConsoleHelp.Log($"[{ curCount }/{sumCount} f]  " + fileName);
                 }
 
                 if (printDirectory)
@@ -128,7 +129,7 @@ namespace FileZip.Cmd
         }
         #endregion
 
- 
+
 
 
     }

+ 1 - 1
FileZip/FileZip.csproj

@@ -3,7 +3,7 @@
 	<PropertyGroup>
 		<OutputType>Exe</OutputType>
 		<TargetFramework>netcoreapp2.1</TargetFramework>
-		<Version>1.6-temp</Version>
+		<Version>1.6</Version>
 	</PropertyGroup>
 
 	<PropertyGroup>

+ 12 - 3
Publish/06.Docker/制作镜像/filezip/Dockerfile

@@ -1,4 +1,13 @@
 FROM serset/dotnet:2.1
-COPY app /root/app
-WORKDIR /root/app
-CMD dotnet FileZip.dll help
+
+
+#(x.1)install zip unzip
+RUN apt-get update && apt-get -y install zip unzip
+
+#(x.2)alias filezip
+RUN echo '#!/bin/bash\ndotnet /root/filezip/FileZip.dll $*' > /usr/bin/filezip && chmod +x /usr/bin/filezip
+
+#(x.3)app
+COPY app /root/filezip
+WORKDIR /root/filezip
+CMD dotnet /root/filezip/FileZip.dll help

+ 1 - 1
Publish/脚本/制作docker镜像/docker镜像-1.复制文件.bat

@@ -1,6 +1,6 @@
 echo '复制文件'
 
 ::制作镜像
-xcopy "..\..\04.服务站点\FileZip"  "..\..\06.Docker\制作镜像\filezip\app\filezip"  /e /i /r /y
+xcopy "..\..\04.服务站点\FileZip"  "..\..\06.Docker\制作镜像\filezip\app"  /e /i /r /y
 
 

+ 1 - 1
Publish/脚本/制作docker镜像/docker镜像-2.删除文件.bat

@@ -1,4 +1,4 @@
 echo '删除文件'
  
 
-rd /s/q "..\..\06.Docker\制作镜像\filezip\app\filezip"
+rd /s/q "..\..\06.Docker\制作镜像\filezip\app"

+ 5 - 1
README.md

@@ -3,6 +3,7 @@
 > 运行环境 dotnet core 2.1
 
 ## 1. demo
+> 注: 在容器中  filezip = dotnet /root/filezip/FileZip.dll
 ``` bash
 # 查看帮助
 dotnet FileZip.dll
@@ -18,10 +19,13 @@ dotnet FileZip.dll unzip -i "E:\t\m.7z" -o "E:\t\t2"
 ``` bash
 # 查看帮助
 docker run --rm -it serset/filezip
+docker run --rm -it serset/filezip filezip help
 
 
 # 解压文件m.7z到文件夹 /root/docker/file/m
-docker run --rm -it -v /root/docker/file:/root/file serset/filezip  dotnet FileZip.dll unzip -i /root/file/m.7z -o /root/file/m
+docker run --rm -it -v /root/docker/file:/root/file serset/filezip dotnet FileZip.dll unzip -i /root/file/m.7z -o /root/file/m
+
+docker run --rm -it -v /root/docker/file:/root/file serset/filezip filezip unzip -i /root/file/m.7z -o /root/file/m
 
 ```