forked from XistGG/UnrealXistTools
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRider.ps1
62 lines (47 loc) · 1.42 KB
/
Rider.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
52
53
54
55
56
57
58
59
60
61
62
#
# Rider.ps1
#
# Open Rider for the given Uproject (or -Sln)
#
# For this to work, set your JetBrains Toolbox to use the script name "Rider1"
# for the version of Rider you want to use by default.
#
# Conversely, override $env:RiderCommand to set an alternate default.
#
[CmdletBinding()]
param(
[Parameter()]$Path,
[switch]$Sln
)
# Set $env:RiderCommand to override the default value
$RiderCommand = $env:RiderCommand ? $env:RiderCommand : "Rider1"
################################################################################
## Main
################################################################################
if ($Sln)
{
# Require a valid $UProjectSln
Write-Debug "Compute UProjectSln Path=[$Path]"
$UProjectSln =& $PSScriptRoot/UProjectSln.ps1 -Path:$Path
if (!$UProjectSln -or !$UProjectSln.Exists)
{
throw "Path is not a Solution: $Path"
}
# Start Rider for the .sln
$RiderFile = $UProjectSln
}
else
{
# Require a valid $UProjectFile
Write-Debug "Compute UProjectFile Path=[$Path]"
$UProjectFile =& $PSScriptRoot/UProjectFile.ps1 -Path:$Path
if (!$UProjectFile -or !$UProjectFile.Exists)
{
throw "Path is not a UProject: $Path"
}
# Start Rider for the .uproject
$RiderFile = $UProjectFile
}
# Start Rider in the requested mode
Write-Debug "EXEC: Rider [$RiderCommand] on [$($RiderFile.FullName)]"
& $RiderCommand $RiderFile.FullName