Skip to content

Commit

Permalink
Merge branch 'LunarVim:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mfauzaan authored Apr 1, 2024
2 parents ad0f1ab + 9ee3b7b commit d880ac6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
1 change: 0 additions & 1 deletion lua/lvim/config/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ M.load_default_options = function()
fileencoding = "utf-8", -- the encoding written to a file
foldmethod = "manual", -- folding, set to "expr" for treesitter based folding
foldexpr = "", -- set to "nvim_treesitter#foldexpr()" for treesitter based folding
guifont = "monospace:h17", -- the font used in graphical neovim applications
hidden = true, -- required to keep multiple buffers and open multiple buffers
hlsearch = true, -- highlight all matches on previous search pattern
ignorecase = true, -- ignore case in search patterns
Expand Down
26 changes: 17 additions & 9 deletions utils/installer/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -85,30 +85,38 @@ function print_missing_dep_msg($dep) {
Write-Output "Please install it first and re-run the installer."
}

$winget_package_matrix=@{"git" = "Git.Git"; "nvim" = "Neovim.Neovim"; "make" = "GnuWin32.Make"; "node" = "OpenJS.NodeJS"; "pip" = "Python.Python.3"}
$scoop_package_matrix=@{"git" = "git"; "nvim" = "neovim-nightly"; "make" = "make"; "node" = "nodejs"; "pip" = "python3"}
$winget_package_matrix=@{"git" = "Git.Git"; "nvim" = "Neovim.Neovim"; "make" = "GnuWin32.Make"; "node" = "OpenJS.NodeJS"; "pip" = "Python.Python.3.11"}
$winget_additional_arguments_matrix=@{"git" = "--source winget --interactive"; "nvim" = "--interactive"; "make" = "--interactive"; "node" = ""; "pip" = ""}

$scoop_package_matrix=@{"git" = "git"; "nvim" = "neovim"; "make" = "make"; "node" = "nodejs"; "pip" = "python"}

function install_system_package($dep) {
# Make installers sometimes have a problem when adding make to path
Write-Output "WARNING: Preparing 'make' installation. The make directory ('C:\Program Files (x86)\GnuWin32\bin') might not be added to the PATH by the installer, and you might have to manually to the PATH!"
if (Get-Command -Name "winget" -ErrorAction SilentlyContinue) {
Write-Output "Attempting to install dependency [$dep] with winget"
$install_cmd = "winget install --interactive $winget_package_matrix[$dep]"

$command="winget"
$command_arguments = "-e --id $($winget_package_matrix[$dep]) $($winget_additional_arguments_matrix[$dep])".Trim() -split ' '
}
elseif (Get-Command -Name "scoop" -ErrorAction SilentlyContinue) {
Write-Output "Attempting to install dependency [$dep] with scoop"
# TODO: check if it's fine to not run it with --global
$install_cmd = "scoop install $scoop_package_matrix[$dep]"
$command = "scoop"
$command_arguments = "$($scoop_package_matrix[$dep])".Trim() -split ' '
}
else {
print_missing_dep_msg "$dep"
exit 1
}

try {
Invoke-Command $install_cmd -ErrorAction Stop
}
catch {
print_missing_dep_msg "$dep"
exit 1
& $command install $command_arguments
# Refresh the path after installation
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
} catch {
Write-Output "An error occurred: $_"
exit 1
}
}

Expand Down

0 comments on commit d880ac6

Please sign in to comment.