Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
ClockworkLZL
ARTEX
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
ARTEX
/
start.bat
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
54 lines (47 loc) · 1.61 KB
main
Breadcrumbs
ARTEX
/
start.bat
Copy path
Top
File metadata and controls
Code
Blame
54 lines (47 loc) · 1.61 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
@
echo
off
rem
控制台切 UTF-8,否则本文件里的中文在 GBK 终端下是乱码。
chcp
65001
>
nul
2
>&
1
rem
ARTEX 守护启动脚本(Windows)
rem
rem
用法:
rem
start.bat 前台运行(Ctrl-C 停止)
rem
start.bat -addr :9000 额外参数原样透传给 artex
rem
rem
它只做一件事:把 artex.exe 跑起来,进程退出后按退出码决定要不要再拉起。
rem
rem
0 用户正常停止 -
>
退出循环
rem
75 程序请求重启 -
>
立刻重跑(页面点了"一键更新"或"回滚")
rem
其他 崩溃 -
>
退避后重跑(1-
>
2-
>
4…最多 60 秒)
rem
rem
下载、SHA256 校验、换装都不在这里,全部由 artex 自己在启动时完成
rem
(selfupdate 包)。脚本保持傻瓜化,详见 start.sh 顶部的说明。
setlocal
enabledelayedexpansion
cd
/d
"
%~dp0
"
set
"
BIN
=
artex.exe
"
if
not
exist
"
%BIN%
"
(
echo
[artex] 找不到可执行文件
%BIN%
1
>&
2
exit
/b
1
)
set
"
RESTART_CODE
=
75
"
set
"
MAX_DELAY
=
60
"
set
/a
delay
=
1
:
loop
"
%BIN%
"
%*
set
"
code
=
!ERRORLEVEL!
"
if
"
!code!
"
==
"
0
"
(
echo
[artex] 正常退出
exit
/b
0
)
if
"
!code!
"
==
"
%RESTART_CODE%
"
(
rem
更新/回滚已就绪:重跑后 artex 会在启动时完成换装。
echo
[artex] 请求重启(应用新版本)…
set
/a
delay
=
1
goto
loop
)
echo
[artex] 异常退出
^
(code=
!code!
^
),
!delay!
s 后重启
1
>&
2
rem
timeout 在被重定向的控制台里会失败,用 ping 兜底(延时 N 秒需要 N+1 次)。
set
/a
pings
=
!
delay
!
+
1
ping
-n
!pings!
127.0.0.1
>
nul
2
>&
1
set
/a
delay
=
!
delay
!
*
2
if
!delay!
gtr
%MAX_DELAY%
set
/a
delay
=
%MAX_DELAY%
goto
loop
You can’t perform that action at this time.