1
0
mirror of https://github.com/akpaevj/executor-scripts.git synced 2025-07-14 06:44:20 +02:00
This commit is contained in:
akpaevj
2024-02-19 23:13:42 +03:00
parent cc609df401
commit bcfe23b0d8
4 changed files with 75 additions and 20 deletions

18
.vscode/launch.json vendored
View File

@ -8,15 +8,21 @@
"name": "Executor", "name": "Executor",
"type": "sbsl", "type": "sbsl",
"request": "launch", "request": "launch",
"scriptFile": "${file}", "scriptFile": "${file",
"args": [ "args": [
"8.3.23.2040", "::ZipFolder",
"W228\\USR1CV8", "C:\\Users\\akpaev.e\\Desktop\\test3",
"N3Ak8bPu7", "C:\\Users\\akpaev.e\\Desktop\\test3.zip",
"erp_main_extension_2765112a", "True"
"C:\\Users\\akpaev.e\\Desktop\\erp-ibsrv-config.yml"
] ]
// "args": [ // "args": [
// "8.3.23.2040",
// "W228\\USR1CV8",
// "N3Ak8bPu7",
// "erp_main_extension_2765112a",
// "C:\\Users\\akpaev.e\\Desktop\\erp-ibsrv-config.yml"
// ]
// "args": [
// "C:\\Users\\akpaev.e\\Desktop\\erp-ibsrv-config2.yml", // "C:\\Users\\akpaev.e\\Desktop\\erp-ibsrv-config2.yml",
// "http.http-services.service.name", // "http.http-services.service.name",
// "testvalue" // "testvalue"

View File

@ -33,7 +33,7 @@ method BuildXmlFiles(
Files.Delete(DataPath) Files.Delete(DataPath)
val ArchivePath = IO.JoinPath(new File(ProjectPath).Path, "${new File(ProjectPath).Name}.zip") val ArchivePath = IO.JoinPath(new File(ProjectPath).Path, "${new File(ProjectPath).Name}.zip")
Zip.ZipFolder(BuildPath, ArchivePath) Zip.ZipFolder(BuildPath.Path, ArchivePath)
Console.Write("Zipped project path: ${ArchivePath}") Console.Write("Zipped project path: ${ArchivePath}")
Files.Delete(BuildPath) Files.Delete(BuildPath)

View File

@ -1,21 +1,28 @@
@Global #required IO.sbsl
method ZipFolder(Folder: File, ArchivePath: String)
val ArchiveFile = new File(ArchivePath)
var Writer = new ZipWriter(ArchiveFile.OpenWritableStream())
for F in Folder.Children @Global
AddToZipArchive(Writer, F, Folder) method ZipFolder(FolderPath: String, ArchivePath: String, ZipChildren: Boolean = True)
val Folder = new File(FolderPath)
val Archive = new File(ArchivePath)
var Writer = new ZipWriter(Archive.OpenWritableStream())
if ZipChildren
for File in Folder.Children
AddToZipArchive(File, Writer)
;
else
AddToZipArchive(Folder, Writer)
; ;
Writer.Write() Writer.Write()
; ;
method AddToZipArchive(Writer: ZipWriter, Source: File, Folder: File) method AddToZipArchive(FileToZipping: File, Writer: ZipWriter, Path: String = "")
if Source.IsFile() if FileToZipping.IsFile()
Writer.Add(Source.OpenReadableStream(), Source.Path.Replace(Folder.Path, "")) Writer.Add(FileToZipping.OpenReadableStream(), IO.JoinPath(Path, FileToZipping.Name))
; else
for File in FileToZipping.Children
for F in Source.Children AddToZipArchive(File, Writer, IO.JoinPath(Path, FileToZipping.Name))
AddToZipArchive(Writer, F, Folder) ;
; ;
; ;

File diff suppressed because one or more lines are too long