From 695e80acff0bbe20286ef368cfec7bc14150e53b Mon Sep 17 00:00:00 2001 From: Kevin Silvester Date: Wed, 3 May 2023 16:01:35 +0100 Subject: [PATCH 1/2] install: create install script for windows --- install.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 install.ps1 diff --git a/install.ps1 b/install.ps1 new file mode 100644 index 0000000..7a6cf4f --- /dev/null +++ b/install.ps1 @@ -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 + From b1f21a2bab6daae692460b28895291db38306139 Mon Sep 17 00:00:00 2001 From: KevinSilvester <56918431+KevinSilvester@users.noreply.github.com> Date: Wed, 3 May 2023 18:15:42 +0100 Subject: [PATCH 2/2] docs: add windows build script to readme --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index 01deb1f..f5e03f2 100644 --- a/readme.md +++ b/readme.md @@ -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 } }