FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
openai-python/scripts/mock at main · dfqytcom/openai-python · GitHub
dfqytcom
/
openai-python
Public
forked from
openai/openai-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
openai-python
/
scripts
/
mock
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
41 lines (32 loc) · 860 Bytes
Breadcrumbs
openai-python
/
scripts
/
mock
Copy path
File metadata and controls
executable file
·
41 lines (32 loc) · 860 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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!
/usr/bin/env bash
set
-e
cd
"
$(
dirname
"
$0
"
)
/..
"
if
[[
-n
"
$1
"
&&
"
$1
"
!=
'
--
'
*
]]
;
then
URL=
"
$1
"
shift
else
URL=
"
$(
grep
'
openapi_spec_url
'
.stats.yml
|
cut -d
'
'
-f2
)
"
fi
#
Check if the URL is empty
if
[
-z
"
$URL
"
]
;
then
echo
"
Error: No OpenAPI spec path/url provided or found in .stats.yml
"
exit
1
fi
echo
"
==> Starting mock server with URL
${URL}
"
#
Run prism mock on the given spec
if
[
"
$1
"
==
"
--daemon
"
]
;
then
npm
exec
--package=@stoplight/prism-cli@~5.8 -- prism mock
"
$URL
"
&
>
.prism.log
&
#
Wait for server to come online
echo
-n
"
Waiting for server
"
while
!
grep -q
"
✖ fatal\|Prism is listening
"
"
.prism.log
"
;
do
echo
-n
"
.
"
sleep 0.1
done
if
grep -q
"
✖ fatal
"
"
.prism.log
"
;
then
cat .prism.log
exit
1
fi
echo
else
npm
exec
--package=@stoplight/prism-cli@~5.8 -- prism mock
"
$URL
"
fi
Back
|
FazBrowse Home
|
New Git URL