FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
spark-cli/scripts/install-binary.ps1 at main · variableway/spark-cli · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
variableway
/
spark-cli
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
spark-cli
/
scripts
/
install-binary.ps1
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (25 loc) · 1.11 KB
Breadcrumbs
spark-cli
/
scripts
/
install-binary.ps1
Copy path
File metadata and controls
29 lines (25 loc) · 1.11 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#
Install the just-built spark binary into ~/.local/bin in a way that keeps
#
both `spark.exe` (Windows) and `spark` (no extension) in sync, so bash
#
cannot pick up a stale shadow file.
[
CmdletBinding
()]
param
(
[
string
]
$Source
=
"
spark.exe
"
,
[
string
]
$InstallDir
=
"
$HOME
\.local\bin
"
)
$ErrorActionPreference
=
"
Stop
"
if
(
-not
(
Test-Path
$Source
)) {
Write-Host
(
"
Source binary not found: {0}
"
-f
$Source
)
exit
1
}
New-Item
-
ItemType Directory
-
Force
-
Path
$InstallDir
|
Out-Null
#
On Windows bash matches the extension-less file first when both exist,
#
so we MUST keep them in sync. Drop any stale shadow first, then copy.
if
(
$IsWindows
-or
$
env:
OS
-eq
"
Windows_NT
"
) {
Remove-Item
-
Force
-
ErrorAction SilentlyContinue (
Join-Path
$InstallDir
"
spark
"
)
Copy-Item
-
Force
$Source
(
Join-Path
$InstallDir
"
spark.exe
"
)
Copy-Item
-
Force
$Source
(
Join-Path
$InstallDir
"
spark
"
)
Write-Host
(
"
Installed {0} -> {1}/spark.exe and {1}/spark
"
-f
$Source
,
$InstallDir
)
}
else
{
Copy-Item
-
Force
$Source
(
Join-Path
$InstallDir
"
spark
"
)
Write-Host
(
"
Installed {0} -> {1}/spark
"
-f
$Source
,
$InstallDir
)
}
Back
|
FazBrowse Home
|
New Git URL