Skip to content

Commit

Permalink
fixed windows white space installation issue #30 (#31)
Browse files Browse the repository at this point in the history
* fixed windows white space installation issue

* Update install.ps1

* Update install.ps1

* Update install.ps1

---------

Co-authored-by: Vicente Eduardo Ferrer Garcia <[email protected]>
  • Loading branch information
RohanKrMahato and viferga authored Oct 10, 2024
1 parent 3646d28 commit a82a8ab
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -241,35 +241,35 @@ function Install-Tarball([string]$InstallDir, [string]$Version) {
}

function Set-NodePath {
param (
[string]$FilePath
)
$NodePath = "$env:LocalAppData\MetaCall\metacall\runtimes\nodejs\node.exe"
if (-not (Test-Path $FilePath)) {
Write-Error "The file $FilePath does not exist."
return
}
$content = Get-Content -Path $FilePath
$content = $content -replace '%dp0%\\node.exe', $NodePath
$content = $content -replace '""', '"'
Set-Content -Path $FilePath -Value $content
param (
[string]$FilePath
)
$NodePath = "`"$env:LocalAppData\MetaCall\metacall\runtimes\nodejs\node.exe`""
if (-not (Test-Path $FilePath)) {
Write-Error "The file $FilePath does not exist."
return
}
$content = Get-Content -Path "$FilePath"
$content = $content -replace '%dp0%\\node.exe', "$NodePath"
$content = $content -replace '""', '"'
Set-Content -Path "$FilePath" -Value "$content"
}

function Install-MetaCall-AdditionalPackages {
param (
[string]$Component
)
$InstallRoot = Resolve-Installation-Path $InstallDir
$InstallDir = Join-Path -Path $InstallRoot -ChildPath "deps\$Component"

if (-not (Test-Path $InstallDir)) {
New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null
}

Write-Host "MetaCall $($Component) Installation"
Invoke-Expression "npm install --global --prefix=$InstallDir @metacall/$Component"
Set-NodePath "$InstallDir\metacall-$Component.cmd"
Write-Host "MetaCall $Component has been installed."
param (
[string]$Component
)
$InstallRoot = Resolve-Installation-Path "$InstallDir"
$InstallDir = Join-Path -Path "$InstallRoot" -ChildPath "deps\$Component"

if (-not (Test-Path $InstallDir)) {
New-Item -ItemType Directory -Force -Path "$InstallDir" | Out-Null
}

Write-Host "MetaCall $($Component) Installation"
Invoke-Expression "npm install --global --prefix=`"$InstallDir`" @metacall/$Component"
Set-NodePath "$InstallDir\metacall-$Component.cmd"
Write-Host "MetaCall $Component has been installed."
}

# Install the tarball and post scripts
Expand Down

0 comments on commit a82a8ab

Please sign in to comment.