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",
"type": "sbsl",
"request": "launch",
"scriptFile": "${file}",
"scriptFile": "${file",
"args": [
"8.3.23.2040",
"W228\\USR1CV8",
"N3Ak8bPu7",
"erp_main_extension_2765112a",
"C:\\Users\\akpaev.e\\Desktop\\erp-ibsrv-config.yml"
"::ZipFolder",
"C:\\Users\\akpaev.e\\Desktop\\test3",
"C:\\Users\\akpaev.e\\Desktop\\test3.zip",
"True"
]
// "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",
// "http.http-services.service.name",
// "testvalue"

View File

@ -33,7 +33,7 @@ method BuildXmlFiles(
Files.Delete(DataPath)
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}")
Files.Delete(BuildPath)

View File

@ -1,21 +1,28 @@
@Global
method ZipFolder(Folder: File, ArchivePath: String)
val ArchiveFile = new File(ArchivePath)
var Writer = new ZipWriter(ArchiveFile.OpenWritableStream())
#required IO.sbsl
for F in Folder.Children
AddToZipArchive(Writer, F, Folder)
@Global
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()
;
method AddToZipArchive(Writer: ZipWriter, Source: File, Folder: File)
if Source.IsFile()
Writer.Add(Source.OpenReadableStream(), Source.Path.Replace(Folder.Path, ""))
;
for F in Source.Children
AddToZipArchive(Writer, F, Folder)
method AddToZipArchive(FileToZipping: File, Writer: ZipWriter, Path: String = "")
if FileToZipping.IsFile()
Writer.Add(FileToZipping.OpenReadableStream(), IO.JoinPath(Path, FileToZipping.Name))
else
for File in FileToZipping.Children
AddToZipArchive(File, Writer, IO.JoinPath(Path, FileToZipping.Name))
;
;
;

File diff suppressed because one or more lines are too long