FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sim/scripts/format-generated-source.ts at main · simstudioai/sim · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
simstudioai
/
sim
Public
Notifications
You must be signed in to change notification settings
Fork
3.8k
Star
29.5k
Code
Issues
119
Pull requests
194
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
sim
/
scripts
/
format-generated-source.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
19 lines (16 loc) · 518 Bytes
Breadcrumbs
sim
/
scripts
/
format-generated-source.ts
Copy path
File metadata and controls
19 lines (16 loc) · 518 Bytes
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
import
{
spawnSync
}
from
'node:child_process'
export
function
formatGeneratedSource
(
source
:
string
,
stdinFilePath
:
string
,
cwd
:
string
)
:
string
{
const
result
=
spawnSync
(
'bunx'
,
[
'biome'
,
'format'
,
'--stdin-file-path'
,
stdinFilePath
]
,
{
cwd
,
encoding
:
'utf8'
,
input
:
source
,
}
)
if
(
result
.
status
!==
0
)
{
throw
new
Error
(
`Failed to format generated source for
${
stdinFilePath
}
:\n
${
result
.
stderr
||
result
.
stdout
||
'unknown error'
}
`
)
}
return
result
.
stdout
}
Back
|
FazBrowse Home
|
New Git URL