-
Notifications
You must be signed in to change notification settings - Fork 287
Expand file tree
/
Copy pathmise.toml
More file actions
143 lines (124 loc) · 4.65 KB
/
mise.toml
File metadata and controls
143 lines (124 loc) · 4.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
[settings]
windows_default_inline_shell_args = "powershell -NoProfile -NoLogo -Command"
[env]
NEOTREE_LUARC = ".luarc.json"
[tools]
lua-language-server = "3.15"
cargo-binstall = "latest"
"cargo:emmylua_ls" = "latest"
"cargo:emmylua_check" = "latest"
"github:EmmyLuaLs/emmylua-analyzer-rust" = "latest"
tree-sitter = "latest"
[tasks.test]
run = """
nvim --headless --noplugin -u tests/mininit.lua -c "lua require('plenary.test_harness').test_directory('tests/neo-tree/', {minimal_init='tests/mininit.lua'})"
"""
[tasks.test-docker]
run = [
"docker build -t neo-tree .",
"docker run --rm neo-tree mise test"
]
[tasks.format]
run = "stylua --glob '*.lua' --glob '!defaults.lua' ."
[vars]
deps_dir = '.dependencies'
[tasks.update-dependencies]
alias = 'deps'
run = """
#!/usr/bin/env bash
update() {
local git_url="$1"
local repo_name="$2"
mkdir -p "{{vars.deps_dir}}"
local target_dir="{{vars.deps_dir}}/$repo_name"
if [ -d "$target_dir" ]; then
echo "==> Directory '$target_dir' exists. Updating $repo_name..."
git -C $target_dir fetch --tags -f
git -C $target_dir pull
# Check the exit code of the subshell command
if [ $? -ne 0 ]; then
echo "Error: Failed to pull updates for '$repo_name'." >&2
return 1
fi
echo "==> Successfully updated '$repo_name'."
else
echo "==> Directory '$target_dir' not found. Cloning repository..."
git clone "$git_url" "$target_dir"
if [ $? -ne 0 ]; then
echo "Error: Failed to clone '$git_url'." >&2
return 1
fi
echo "==> Successfully cloned '$repo_name'."
fi
}
update https://github.com/3rd/image.nvim image.nvim
update https://github.com/folke/snacks.nvim snacks.nvim
update https://github.com/MunifTanjim/nui.nvim nui.nvim
update https://github.com/nvim-tree/nvim-web-devicons nvim-web-devicons
update https://github.com/nvim-lua/plenary.nvim plenary.nvim
update https://github.com/s1n7ax/nvim-window-picker nvim-window-picker
update https://github.com/nvim-treesitter/nvim-treesitter nvim-treesitter
"""
run_windows = """
function Update-Repository {
param(
[Parameter(Mandatory=$true)]
[string]$GitUrl,
[Parameter(Mandatory=$true)]
[string]$RepoName
)
# Ensure the parent directory exists
$DepsDir = "{{vars.deps_dir}}"
if (-not (Test-Path -Path $DepsDir -PathType Container)) {
Write-Host "==> Creating dependency directory '$DepsDir'..."
New-Item -Path $DepsDir -ItemType Directory | Out-Null
}
$TargetDir = Join-Path -Path $DepsDir -ChildPath $RepoName
if (Test-Path -Path $TargetDir -PathType Container) {
Write-Host "==> Directory '$TargetDir' exists. Updating $RepoName..."
git -C $TargetDir fetch --tags -f
git -C $TargetDir pull | Out-Null 2>&1
} else {
Write-Host "==> Directory '$TargetDir' not found. Cloning repository '$GitUrl'..."
git clone $GitUrl $TargetDir
$cloneExitCode = $LASTEXITCODE
Write-Host "==> Successfully cloned '$RepoName'."
}
}
## 🛠️ Repository Update Calls
# Call the function for each repository
Update-Repository -GitUrl "https://github.com/3rd/image.nvim" -RepoName "image.nvim"
Update-Repository -GitUrl "https://github.com/folke/snacks.nvim" -RepoName "snacks.nvim"
Update-Repository -GitUrl "https://github.com/MunifTanjim/nui.nvim" -RepoName "nui.nvim"
Update-Repository -GitUrl "https://github.com/nvim-tree/nvim-web-devicons" -RepoName "nvim-web-devicons"
Update-Repository -GitUrl "https://github.com/nvim-lua/plenary.nvim" -RepoName "plenary.nvim"
Update-Repository -GitUrl "https://github.com/s1n7ax/nvim-window-picker" -RepoName "nvim-window-picker"
Update-Repository -GitUrl "https://github.com/nvim-treesitter/nvim-treesitter" -RepoName "nvim-treesitter"
"""
[tasks.luals-check]
run = """
#!/usr/bin/env bash
VIMRUNTIME_PATH=$(nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'qa')
VIMRUNTIME="${VIMRUNTIME_PATH}" lua-language-server --configpath=$NEOTREE_LUARC --check=.
"""
run_windows = """
$env:VIMRUNTIME = (nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'qa')
lua-language-server --configpath=$env:NEOTREE_LUARC --check .
"""
wait_for = ['deps']
[tasks.emmylua-check]
run = """
#!/usr/bin/env bash
VIMRUNTIME_PATH=$(nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'quit')
VIMRUNTIME="${VIMRUNTIME_PATH}" emmylua_check -c $NEOTREE_LUARC -i ".dependencies/**" -- .
"""
run_windows = """
$env:VIMRUNTIME = (nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'quit')
$env:PWD = Get-Location
emmylua_check -c $env:NEOTREE_LUARC -i ".dependencies/**" -- .
"""
wait_for = ['deps']
[tasks.clean]
run = [
"rm {{vars.deps_dir}} -rf"
]