FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
angular-cli/scripts/devkit-admin.mts at v21.2.25 · angular/angular-cli · GitHub
angular
angular-cli
Repository navigation
Code
Issues
213
(213)
Pull requests
20
(20)
Actions
Security and quality
6
(6)
Insights
Expand file tree
Breadcrumbs
angular-cli
/
scripts
/
devkit-admin.mts
Copy path
More file actions
More file actions
Latest commit
History
History
History
56 lines (50 loc) · 1.38 KB
Breadcrumbs
angular-cli
/
scripts
/
devkit-admin.mts
Copy path
File metadata and controls
56 lines (50 loc) · 1.38 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
#!/usr/bin/env node
/**
*
@license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import
path
from
'node:path'
;
import
{
parseArgs
,
styleText
}
from
'node:util'
;
const
{
values
,
positionals
}
=
parseArgs
(
{
args
:
process
.
argv
.
slice
(
2
)
,
options
:
{
verbose
:
{
type
:
'boolean'
,
}
,
}
,
allowPositionals
:
true
,
strict
:
false
,
// Allow unknown options to pass through.
}
)
;
const
scriptName
=
positionals
.
shift
(
)
;
const
args
=
{
...
values
,
_
:
positionals
,
}
;
const
cwd
=
process
.
cwd
(
)
;
const
scriptDir
=
import
.
meta
.
dirname
;
process
.
chdir
(
path
.
join
(
scriptDir
,
'..'
)
)
;
const
originalConsole
=
{
...
console
}
;
console
.
warn
=
function
(
...
args
)
{
if
(
typeof
args
[
0
]
===
'string'
)
{
args
[
0
]
=
styleText
(
[
'yellow'
]
,
args
[
0
]
)
;
}
originalConsole
.
warn
(
...
args
)
;
}
;
console
.
error
=
function
(
...
args
)
{
if
(
typeof
args
[
0
]
===
'string'
)
{
args
[
0
]
=
styleText
(
[
'red'
]
,
args
[
0
]
)
;
}
originalConsole
.
error
(
...
args
)
;
}
;
try
{
const
script
=
await
import
(
`./
${
scriptName
}
.mts`
)
;
const
exitCode
=
await
script
.
default
(
args
,
cwd
)
;
process
.
exitCode
=
typeof
exitCode
===
'number'
?
exitCode
:
0
;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
}
catch
(
err
:
any
)
{
console
.
error
(
err
.
stack
??
err
)
;
process
.
exitCode
=
99
;
}
Back
|
FazBrowse Home
|
New Git URL