Skip to content

Commit b6fde60

Browse files
committed
ci: improve scripts for easier content synchronization
Details: - It should be now just `make sync` -> possibly inspect new commits -> `git push origin`
1 parent 6c1f73a commit b6fde60

File tree

4 files changed

+42
-12
lines changed

4 files changed

+42
-12
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1+
.PHONY: mini.nvim MiniMax
2+
13
# mini.nvim
24
_deps/mini.nvim:
35
@mkdir -p _deps
46
git clone --filter=blob:none https://github.com/nvim-mini/mini.nvim $@
57

6-
mini_nvim: _deps/mini.nvim
8+
mini.nvim: _deps/mini.nvim
79
chmod u+x _scripts/mini_nvim.sh && _scripts/mini_nvim.sh
810

911
# MiniMax
1012
_deps/MiniMax:
1113
@mkdir -p _deps
12-
git clone --filter=blob:none https://github.com/echasnovski/MiniMax $@
14+
git clone --filter=blob:none https://github.com/nvim-mini/MiniMax $@
1315

1416
MiniMax: _deps/MiniMax
1517
chmod u+x _scripts/minimax.sh && _scripts/minimax.sh
18+
19+
# Sync
20+
sync: mini.nvim MiniMax
21+
chmod u+x _scripts/sync.sh && _scripts/sync.sh

_scripts/mini_nvim.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# Clean copy necessary files with proper routing
2-
if [[ -d "mini.nvim" ]]
3-
then
4-
rm -rf mini.nvim
5-
fi
1+
# Make sure upstream is up to date. In case of error (like if there was force
2+
# push), manually delete upstream directory and rerun `make` command.
3+
git -C _deps/mini.nvim pull
64

5+
# Clean copy necessary files with proper routing
6+
rm -rf mini.nvim
77
mkdir -p mini.nvim
8+
89
cp _deps/mini.nvim/README.md mini.nvim/index.md
910
cp _deps/mini.nvim/logo.png mini.nvim/logo.png
1011
cp _deps/mini.nvim/CHANGELOG.md mini.nvim/CHANGELOG.md
@@ -15,4 +16,5 @@ cp _deps/mini.nvim/scripts/init-deps-example.lua mini.nvim/scripts/init-deps-exa
1516
cp -r _deps/mini.nvim/readmes mini.nvim/readmes
1617
cp -r _deps/mini.nvim/doc mini.nvim/doc
1718

19+
# Adjust freshly copied files to better fit Quarto generation
1820
nvim -l ./_scripts/mini_nvim.lua

_scripts/minimax.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# Clean copy necessary files with proper routing
2-
if [[ -d "MiniMax" ]]
3-
then
4-
rm -rf MiniMax
5-
fi
1+
# Make sure upstream is up to date. In case of error (like if there was force
2+
# push), manually delete upstream directory and rerun `make` command.
3+
git -C _deps/MiniMax pull
64

5+
# Clean copy necessary files with proper routing
6+
rm -rf MiniMax
77
mkdir -p MiniMax
8+
89
cp _deps/MiniMax/README.md MiniMax/index.md
910
cp _deps/MiniMax/logo.png MiniMax/logo.png
1011
cp _deps/MiniMax/CHANGELOG.md MiniMax/CHANGELOG.md
1112
cp -r _deps/MiniMax/configs MiniMax/configs
1213
mv MiniMax/configs/README.md MiniMax/configs/index.md
1314

15+
# Adjust freshly copied files to better fit Quarto generation
1416
nvim -l ./_scripts/minimax.lua

_scripts/sync.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# General idea: check if respective `make` targets resulted in content
2+
# change; if yes - add+commit them (separately for each target) with helpful
3+
# commit messages
4+
5+
# 'mini.nvim'
6+
if [[ `git status --porcelain -- mini.nvim/*` ]]; then
7+
commit=$(git -C _deps/mini.nvim rev-list -1 --abbrev-commit HEAD)
8+
git add mini.nvim/*
9+
git commit -m "feat(mini.nvim): sync to $commit"
10+
fi
11+
12+
# MiniMax
13+
if [[ `git status --porcelain -- MiniMax/*` ]]; then
14+
commit=$(git -C _deps/MiniMax rev-list -1 --abbrev-commit HEAD)
15+
git add MiniMax/*
16+
git commit -m "feat(minimax): sync to $commit"
17+
fi
18+
19+
# Possibly show new commits
20+
git log --oneline origin/main..HEAD

0 commit comments

Comments
 (0)