-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CopyToWoW.ps1
51 lines (36 loc) · 1.33 KB
/
CopyToWoW.ps1
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
<# RESOURCES #>
<# Addons #>
$addons = @()
#List of addon folders to copy from the source folder
$addons += "WidgetTools"
<# Clients #>
$clients = @()
#List of client tags used by Blizzard to target
$clients += "_retail_" #Dragonflight
$clients += "_ptr_" #Dragonflight PTR
$clients += "_xptr_" #Dragonflight PTR X
$clients += "_classic_" #Wrath of the Lich King
$clients += "_classic_ptr_" #Wrath of the Lick King PTR
$clients += "_classic_era_" #Classic
$clients += "_classic_era_ptr_" #Classic PTR
<# INSTALLATION #>
<# Assemble the paths #>
$source = Get-Location
#Path text file (Note: This is the root install location of World of Warcraft.)
$pathFile = Join-Path $source "\.vscode\WoWDirectory.txt"
#Source path to fill
$source = Join-Path $source "\[addon]\*"
#Destination path to fill
$destination = Get-Content -Path $pathFile
$destination = Join-Path $destination "\[client]\Interface\Addons\[addon]\"
<# Copy the files #>
foreach ($addon in $addons) {
foreach ($client in $clients) {
#Fill in the paths
$sourcePath = $source -replace "\[addon\]", $addon
$destinationPath = $destination -replace "\[client\]", $client -replace "\[addon\]", $addon
#Install the addon
if (!(Test-Path -Path $destinationPath)) { New-Item $destinationPath -Type Directory }
Copy-Item $sourcePath -Destination $destinationPath -Recurse -Force
}
}