Merge pull request #10 from KevinSilvester/main

install: create install script for windows
This commit is contained in:
Barrett Ruth 2023-05-03 15:37:09 -04:00 committed by GitHub
commit 09257b8eaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

19
install.ps1 Normal file
View file

@ -0,0 +1,19 @@
Param(
[Parameter(Mandatory=$true)]
[ValidateSet('npm','yarn','pnpm', ErrorMessage = 'Must provide node.js package manager')]
[string]$package_manager
)
git clone 'https://github.com/wix/import-cost.git'
if (-not $?) {
Write-Host 'Failed to clone wix/import-cost' -ForegroundColor Red
exit 1
}
cd import-cost
if (-not $?) { exit 1 }
iex "$package_manager install"
cd ..
cp .\index.js .\import-cost\index.js

View file

@ -22,6 +22,8 @@ require('lazy').setup {
{
'barrett-ruth/import-cost.nvim',
build = 'sh install.sh yarn',
-- if on windows
-- build = 'pwsh install.ps1 yarn',
config = true
}
}