Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
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 }}
helloworldiambeok
artex-ymh
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
artex-ymh
/
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-ymh
/
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.