Skip to content

Commit 88123dc

Browse files
author
Zhen Li
committed
Made the powershell script to accept args
Made the powershell script to stop server even after ctrl+C
1 parent f35fe3c commit 88123dc

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

runTests.ps1

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
1-
param(
2-
[string]$input
3-
)
1+
npm install
42

5-
npm installs
3+
$ErrorFound = $False
64

7-
If ($input)
5+
try
86
{
9-
npm run start-neo4j -- --neorun.start.args=\'"$input"\'
10-
}
11-
else
12-
{
13-
npm run start-neo4j
14-
}
15-
npm test
7+
If ($args.Length -eq 0)
8+
{
9+
npm run start-neo4j
10+
}
11+
else
12+
{
13+
npm run start-neo4j -- --neorun.start.args="$args"
14+
}
1615

17-
if(-Not ($?)) #failed to execute npm test
18-
{
19-
$ErrorFound = $True
16+
npm test
17+
if(-Not ($?)) #failed to execute npm test
18+
{
19+
$ErrorFound = $True
20+
}
2021
}
21-
22-
npm run stop-neo4j
23-
24-
if($ErrorFound -eq $True)
22+
finally
2523
{
26-
exit 1
24+
npm run stop-neo4j
25+
if($ErrorFound -eq $True)
26+
{
27+
Write-Host "Exit with code 1"
28+
exit 1
29+
}
30+
Write-Host "Exit with code 0"
2731
}

0 commit comments

Comments
 (0)