Commit be9a8c8 1 parent 85792c0 commit be9a8c8 Copy full SHA for be9a8c8
File tree 10 files changed +67
-30
lines changed
10 files changed +67
-30
lines changed Original file line number Diff line number Diff line change 1
- # # Merger hooks, run tools/hooks/install.bat or install.sh to set up
1
+ # # Merge hooks, run tools/hooks/install.bat or install.sh to set up
2
2
* .dmm text eol =lf merge =dmm
3
3
* .dmi binary merge =dmi
4
+ # # TGUI bundle merge drivers
5
+ * .bundle. * binary merge =tgui-merge-bundle
6
+ * .chunk. * binary merge =tgui-merge-bundle
Original file line number Diff line number Diff line change @@ -14,24 +14,34 @@ jobs:
14
14
runs-on : ubuntu-22.04
15
15
steps :
16
16
- uses : actions/checkout@v4
17
+
17
18
- name : Setup Cache
18
19
uses : actions/cache@v4
19
20
with :
20
21
path : $HOME/SpacemanDMM
21
22
key : ${{ runner.os }}-spacemandmm
23
+
22
24
- name : Install Tools
23
25
run : |
24
26
bash tools/ci/install_build_deps.sh
25
27
bash tools/ci/install_dreamchecker.sh
28
+
26
29
- uses : actions/setup-python@v5
27
30
with :
28
- python-version : ' 3.10 '
31
+ python-version : ' 3.11 '
29
32
cache : ' pip'
33
+
34
+ - uses : actions/setup-node@v4
35
+ with :
36
+ node-version : 20
37
+ cache : ' yarn'
38
+ cache-dependency-path : ./tgui/yarn.lock
39
+
30
40
- run : pip install -r tools/requirements.txt
31
41
- name : Run Linters
32
42
run : |
33
43
tools/ci/check_json.sh
34
- tools/ci/build_tgui.sh
44
+ tgui/bin/tgui --ci
35
45
python tools/ci/check_grep2.py
36
46
python tools/ci/check_line_endings.py
37
47
python tools/ci/check_file_names.py
41
51
python -m tools.ci.check_icon_conflicts
42
52
python -m tools.ci.check_icon_dupenames
43
53
python -m tools.maplint.source --github
54
+
44
55
- name : Run DreamChecker
45
56
shell : bash
46
57
run : ~/dreamchecker 2>&1 | bash tools/ci/annotate_dm.sh
Original file line number Diff line number Diff line change 20
20
ref : ${{ env.PR_BRANCH }}
21
21
fetch-depth : 0
22
22
23
+ - uses : actions/setup-node@v4
24
+ with :
25
+ node-version : 20
26
+ cache : ' yarn'
27
+ cache-dependency-path : ./tgui/yarn.lock
28
+
23
29
- uses : actions/setup-python@v5
24
30
with :
25
31
python-version : ' 3.11'
32
+ cache : ' pip'
26
33
27
34
- name : Perform Merge
28
35
run : |
Original file line number Diff line number Diff line change @@ -17,7 +17,5 @@ yarn.lock text eol=lf
17
17
bin /tgui text eol =lf
18
18
19
19
# # Treat bundles as binary and ignore them during conflicts
20
- * .bundle. * binary merge =tgui-merge-bundle
21
- * .chunk. * binary merge =tgui-merge-bundle
22
20
.yarn /releases /** /* binary
23
21
.yarn /plugins /** /* binary
Original file line number Diff line number Diff line change @@ -125,18 +125,24 @@ task-install-git-hooks() {
125
125
git_root=" $( git rev-parse --show-toplevel) "
126
126
git_base_dir=" ${base_dir/ ${git_root} / .} "
127
127
git config --replace-all merge.tgui-merge-bundle.driver \
128
- " ${git_base_dir} /bin/tgui --merge=bundle %O %A %B %L"
128
+ " ${git_base_dir} /tgui/ bin/tgui --merge=bundle %P %O %A %B %L"
129
129
echo " tgui: Merge drivers have been successfully installed!"
130
130
}
131
131
132
132
# # Bundle merge driver
133
133
task-merge-bundle () {
134
- local file_ancestor=" ${1} "
135
- local file_current=" ${2} "
136
- local file_other=" ${3} "
137
- local conflict_marker_size=" ${4} "
138
- echo " tgui: Discarding a local tgui build"
139
- # # Do nothing (file_current will be merged and is what we want to keep).
134
+ local file_path=" ${1} "
135
+ local file_ancestor=" ${2} "
136
+ local file_current=" ${3} "
137
+ local file_other=" ${4} "
138
+ local conflict_marker_size=" ${5} "
139
+ echo " ----------------------"
140
+ echo " tgui: rebuilding a conflicted tgui bundle, ${file_path} "
141
+ task-install
142
+ task-webpack --mode=production
143
+ echo " tgui: replacing conflicted bundle with newly compiled bundle"
144
+ cd ../
145
+ cat $file_path > $file_current
140
146
exit 0
141
147
}
142
148
Original file line number Diff line number Diff line change @@ -104,6 +104,13 @@ function task-validate-build {
104
104
Write-Output " tgui: build is ok"
105
105
}
106
106
107
+ # # Installs merge drivers and git hooks
108
+ function task-install-git-hooks () {
109
+ Set-Location $global :basedir
110
+ git config - -replace - all merge.tgui- merge-bundle .driver " tgui/bin/tgui --merge=bundle %P %O %A %B %L"
111
+ Write-Output " tgui: Merge drivers have been successfully installed!"
112
+ }
113
+
107
114
# # Main
108
115
# # --------------------------------------------------------
109
116
@@ -113,6 +120,11 @@ if ($Args.Length -gt 0) {
113
120
exit 0
114
121
}
115
122
123
+ if ($Args [0 ] -eq " --install-git-hooks" ) {
124
+ task- install-git - hooks
125
+ exit 0
126
+ }
127
+
116
128
if ($Args [0 ] -eq " --dev" ) {
117
129
$Rest = $Args | Select-Object - Skip 1
118
130
task- install
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -euo pipefail
3
3
4
- source _build_dependencies.sh
5
-
6
- source ~ /.nvm/nvm.sh
7
- nvm install $NODE_VERSION
8
- nvm use $NODE_VERSION
9
- npm install --global yarn
10
4
python3 -m pip install json5
11
-
Original file line number Diff line number Diff line change 1
1
@ call " %~dp0 \..\bootstrap\python" -m hooks.install %*
2
- @ pause
2
+ @ echo off
3
+ set /p choice = Do you want to install TGUI hooks (requires Node.js)? (Y/N):
4
+
5
+ if /i " %choice% " == " Y" (
6
+ @ echo off
7
+ rem Copyright (c) 2020 Aleksej Komarov
8
+ rem SPDX-License-Identifier: MIT
9
+ call powershell.exe -NoLogo -ExecutionPolicy Bypass -File " %~dp0 \..\..\tgui\bin\tgui_.ps1" --install-git-hooks %*
10
+ rem Pause if launched in a separate shell unless initiated from powershell
11
+ echo %PSModulePath% | findstr %USERPROFILE% > NUL
12
+ if %errorlevel% equ 0 (
13
+ pause
14
+ exit 0
15
+ )
16
+ echo %cmdcmdline% | find /i " /c"
17
+ )
18
+ pause
Original file line number Diff line number Diff line change 1
1
@ call " %~dp0 \..\bootstrap\python" -m hooks.install --uninstall %*
2
+ git config --unset merge.tgui-merge-bundle.driver
2
3
@ pause
You can’t perform that action at this time.
0 commit comments