-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.ps1
40 lines (35 loc) · 949 Bytes
/
run.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
# Use this script to run Rockstar programs in Windows Powershell
# This will pull down the "official" rockstar runner from GitHub
# and install its dependencies, then it will run the program. After
# running the program, it will delete Rockstar to avoid contaminating
# the environment
$name = $args[0]
$start_dir = Get-Location
if (-not $name )
{
echo "ERROR: Specify file to run"
echo "USAGE: 'rockstar my_program.rock'"
Exit
}
$program_path = $test = "$(Get-Location)\$($name)"
if (-not (Test-Path -Path $program_path -PathType Leaf))
{
echo "ERROR: Program file does not exist"
Exit
}
# Run the program, gracefully exit if interrupted
try
{
mkdir rockstar > $null
cd rockstar
git clone https://github.com/RockstarLang/rockstar --quiet
cd rockstar/satriani
npm install --silent
npm run --silent pegjs
node rockstar $program_path
}
finally
{
cd $start_dir
rm -Recurse -Force rockstar
}