Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lua-language-server-srb2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LJ Sonic
lua-language-server-srb2
Commits
5852b8d8
"src/git@git.do.srb2.org:Alam/SRB2.git" did not exist on "525edab73c0a203aa85bfcc4eda3c977afdc5682"
Commit
5852b8d8
authored
4 years ago
by
最萌小汐
Browse files
Options
Downloads
Patches
Plain Diff
close #335 supports `~` in command line
parent
30a5667b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.md
+3
-0
3 additions, 0 deletions
changelog.md
main.lua
+15
-3
15 additions, 3 deletions
main.lua
with
18 additions
and
3 deletions
changelog.md
+
3
−
0
View file @
5852b8d8
# changelog
## 1.9.1
*
`CHG`
supports
`~`
in command line
## 1.9.0
`2020-12-31`
*
`NEW`
YEAR! Peace and love!
...
...
This diff is collapsed.
Click to expand it.
main.lua
+
15
−
3
View file @
5852b8d8
...
...
@@ -2,7 +2,18 @@ local currentPath = debug.getinfo(1, 'S').source:sub(2)
local
rootPath
=
currentPath
:
gsub
(
'[/\\]*[^/\\]-$'
,
''
)
loadfile
((
rootPath
==
''
and
'.'
or
rootPath
)
..
'/platform.lua'
)(
'script'
)
local
fs
=
require
'bee.filesystem'
ROOT
=
fs
.
path
(
rootPath
)
local
function
expanduser
(
path
)
if
path
:
sub
(
1
,
1
)
==
'~'
then
local
home
=
os.getenv
(
'HOME'
)
if
not
home
then
-- has to be Windows
home
=
os.getenv
'USERPROFILE'
or
(
os.getenv
'HOMEDRIVE'
..
os.getenv
'HOMEPATH'
)
end
return
home
..
path
:
sub
(
2
)
else
return
path
end
end
local
function
loadArgs
()
for
_
,
v
in
ipairs
(
arg
)
do
...
...
@@ -22,8 +33,9 @@ end
loadArgs
()
LOGPATH
=
LOGPATH
or
(
ROOT
:
string
()
..
'/log'
)
METAPATH
=
METAPATH
or
(
ROOT
:
string
()
..
'/meta'
)
ROOT
=
fs
.
path
(
expanduser
(
rootPath
))
LOGPATH
=
LOGPATH
and
expanduser
(
LOGPATH
)
or
(
ROOT
:
string
()
..
'/log'
)
METAPATH
=
METAPATH
and
expanduser
(
METAPATH
)
or
(
ROOT
:
string
()
..
'/meta'
)
debug
.
setcstacklimit
(
200
)
collectgarbage
(
'generational'
,
10
,
100
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment