-
Notifications
You must be signed in to change notification settings - Fork 212
/
Copy pathcopyjar.ps1
executable file
·48 lines (42 loc) · 1.29 KB
/
copyjar.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
#
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
function Get-ScriptDirectory
{
$Invocation = (Get-Variable MyInvocation -Scope 1).Value;
if($Invocation.PSScriptRoot)
{
$Invocation.PSScriptRoot;
}
Elseif($Invocation.MyCommand.Path)
{
Split-Path $Invocation.MyCommand.Path
}
else
{
$Invocation.InvocationName.Substring(0,$Invocation.InvocationName.LastIndexOf("\"));
}
}
#
# main body of the script
# this script copies jar file for the release
#
$scriptDir= Get-ScriptDirectory
write-output "Script directory: $scriptDir"
$destDir = "$scriptDir\runtime\lib"
write-output "Directory to which file will be copied to: $destDir"
pushd ..\scala\target
#non-uber jar has original prefix - this is the file that needs to be copied over
$files = get-childitem $configPath -filter "original*"
#only one file in $files
foreach($file in $files)
{
$sourceFileName = $file.Name
write-output "Name of the file to copy: $sourceFileName"
}
$pattern = "^original-(.*)"
$destFileName = $sourceFileName -replace $pattern,'$1'
write-output "Name of the file to use in destination: $destFileName"
copy-item $sourceFileName -Destination "$destDir\$destFileName"
popd