install: create install script for windows
This commit is contained in:
parent
e1c80cb05a
commit
695e80acff
1 changed files with 19 additions and 0 deletions
19
install.ps1
Normal file
19
install.ps1
Normal 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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue