FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
code-oss/scripts/code-perf.js at code-oss-esm · unlicense-code/code-oss · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
unlicense-code
/
code-oss
Public
forked from
lemanschik/code-oss
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
code-oss
/
scripts
/
code-perf.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
91 lines (79 loc) · 2.7 KB
Breadcrumbs
code-oss
/
scripts
/
code-perf.js
Copy path
File metadata and controls
91 lines (79 loc) · 2.7 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//
@ts
-check
const
path
=
require
(
'path'
)
;
const
perf
=
require
(
'@vscode/vscode-perf'
)
;
const
VSCODE_FOLDER
=
path
.
join
(
__dirname
,
'..'
)
;
async
function
main
(
)
{
const
args
=
process
.
argv
;
/**
@type
{
string | undefined
} */
let
build
=
undefined
;
if
(
args
.
indexOf
(
'--help'
)
===
-
1
&&
args
.
indexOf
(
'-h'
)
===
-
1
)
{
// get build arg from args
let
buildArgIndex
=
args
.
indexOf
(
'--build'
)
;
buildArgIndex
=
buildArgIndex
===
-
1
?
args
.
indexOf
(
'-b'
)
:
buildArgIndex
;
if
(
buildArgIndex
===
-
1
)
{
let
runtimeArgIndex
=
args
.
indexOf
(
'--runtime'
)
;
runtimeArgIndex
=
runtimeArgIndex
===
-
1
?
args
.
indexOf
(
'-r'
)
:
runtimeArgIndex
;
if
(
runtimeArgIndex
!==
-
1
&&
args
[
runtimeArgIndex
+
1
]
!==
'desktop'
)
{
console
.
error
(
'Please provide the --build argument. It is an executable file for desktop or a URL for web'
)
;
process
.
exit
(
1
)
;
}
build
=
getLocalCLIPath
(
)
;
}
else
{
build
=
args
[
buildArgIndex
+
1
]
;
if
(
build
!==
'insider'
&&
build
!==
'stable'
&&
build
!==
'exploration'
)
{
build
=
getExePath
(
args
[
buildArgIndex
+
1
]
)
;
}
args
.
splice
(
buildArgIndex
+
1
,
1
)
;
}
args
.
push
(
'--folder'
)
;
args
.
push
(
VSCODE_FOLDER
)
;
args
.
push
(
'--file'
)
;
args
.
push
(
path
.
join
(
VSCODE_FOLDER
,
'package.json'
)
)
;
}
if
(
build
)
{
args
.
push
(
'--build'
)
;
args
.
push
(
build
)
;
}
await
perf
.
run
(
)
;
process
.
exit
(
0
)
;
}
/**
*
@param
{
string
} buildPath
*
@returns
{
string
}
*/
function
getExePath
(
buildPath
)
{
buildPath
=
path
.
normalize
(
path
.
resolve
(
buildPath
)
)
;
if
(
buildPath
===
path
.
normalize
(
getLocalCLIPath
(
)
)
)
{
return
buildPath
;
}
let
relativeExePath
;
switch
(
process
.
platform
)
{
case
'darwin'
:
relativeExePath
=
path
.
join
(
'Contents'
,
'MacOS'
,
'Electron'
)
;
break
;
case
'linux'
:
{
const
product
=
require
(
path
.
join
(
buildPath
,
'resources'
,
'app'
,
'product.json'
)
)
;
relativeExePath
=
product
.
applicationName
;
break
;
}
case
'win32'
:
{
const
product
=
require
(
path
.
join
(
buildPath
,
'resources'
,
'app'
,
'product.json'
)
)
;
relativeExePath
=
`
${
product
.
nameShort
}
.exe`
;
break
;
}
default
:
throw
new
Error
(
'Unsupported platform.'
)
;
}
return
buildPath
.
endsWith
(
relativeExePath
)
?
buildPath
:
path
.
join
(
buildPath
,
relativeExePath
)
;
}
/**
*
@returns
{
string
}
*/
function
getLocalCLIPath
(
)
{
return
process
.
platform
===
'win32'
?
path
.
join
(
VSCODE_FOLDER
,
'scripts'
,
'code.bat'
)
:
path
.
join
(
VSCODE_FOLDER
,
'scripts'
,
'code.sh'
)
;
}
main
(
)
;
Back
|
FazBrowse Home
|
New Git URL