-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathunzip.src
More file actions
39 lines (33 loc) · 971 Bytes
/
unzip.src
File metadata and controls
39 lines (33 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
zipString = "@@@@@@@@";
zipSpacer = "::::::::";
targetZip = params[0];
outputFolder = params[1];
c = get_shell.host_computer;
c.create_folder(c.current_path, outputFolder);
outputBaseFolder = c.File(c.current_path + "/" + outputFolder);
zipFile = c.File(c.current_path + "/" + targetZip);
zipFile = zipFile.content;
zipFiles = zipFile.split(zipSpacer);
makeZipFile = function (filename, filecontent)
filePath = outputBaseFolder.path;
filename = filename[1:];
splix = filename.split("/");
splix = splix[1:];
if splix.len > 0 then
for spli in splix
c.create_folder(filePath, spli);
filePath = filePath + "/" + spli;
end if;
end if
c.touch(filePath, filename.split("/").pop);
fx = c.File(filePath + "/" + filename.split("/").pop);
fx.set_content(filecontent);
end function;
for zipFilx in zipFiles
sp = zipFilx.split(zipString);
if sp.len == 2 then
filePath = sp[0];
fileContent = sp[1];
makeZipFile(filePath, fileContent);
end if;
end for;