/
install.ps1
24 lines (21 loc) · 998 Bytes
/
install.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
# install the prerequisites for the grammar building tools
try {
# create modules folder if it doesn't exist
if (-not (Test-Path modules -PathType Container)) {
New-Item modules -ItemType Directory | Out-Null
}
# clean out any past copies of the build tool repositories
if (Test-Path modules\PwshJSONtoPList -PathType Container) {
Write-Progress 'Removing old PwshJSONtoPList module.'
Remove-Item modules\PwshJSONtoPList -Recurse -Force
}
if (Test-Path modules\PwshOutCSON -PathType Container) {
Write-Progress 'Removing old PwshOutCSON module.'
Remove-Item modules\PwshOutCSON -Recurse -Force
}
# clone some prerequisite repositories that will help build the grammars
git clone --depth 1 https://github.com/msftrncs/PwshJSONtoPList.git modules\PwshJSONtoPList
git clone --depth 1 https://github.com/msftrncs/PwshOutCSON.git modules\PwshOutCSON
} catch {
throw # error occured, give it forward to the user
}