-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautoExport.vbs
52 lines (42 loc) · 1.4 KB
/
autoExport.vbs
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
40
41
42
43
44
45
46
47
48
49
50
51
52
Option Explicit
Dim fguiFolderName, layaFolderName, fguiPkgName
fguiFolderName = "gd_mt\"
fguiPkgName = "MT"
layaFolderName = "multi_texas\"
Dim objFSO, objFolder, objSubFolders, objSubFolder, fsn
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
' 正則用
Dim oRE, bMatch
Set oRE = New RegExp
oRE.Pattern = "assets_"
' IO
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(".\" & fguiFolderName)
Set objSubFolders = objFolder.SubFolders
Dim cmdFairyPath, pwd
cmdFairyPath = "C:\FairyGUI-Editor\FairyGUI-Editor"
pwd = Replace(WScript.ScriptFullName, WScript.ScriptName, "")
Dim execString
' 分支先發布
For each objSubFolder In objSubFolders
bMatch = oRE.Test(objSubFolder.name)
If bMatch Then
fsn = Replace(objSubFolder.name, "assets_", "")
WScript.Stdout.WriteLine "fgui branch: " & fsn
execString = cmdFairyPath & " -p " & pwd & fguiFolderName & fguiPkgName & ".fairy -t " & fsn ' & " -o " & pwd & layaFolderName
' WScript.Stdout.WriteLine execString
Set oExec = WshShell.Exec(execString)
Do While oExec.Status = 0
WScript.Sleep 100
Loop
End If
Next
' 主幹發布
execString = cmdFairyPath & " -p " & pwd & fguiFolderName & fguiPkgName & ".fairy"
Set oExec = WshShell.Exec(execString)
Do While oExec.Status = 0
WScript.Sleep 100
Loop
' 結束
WScript.Stdout.WriteLine "OK!"