FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
octocatalog-diff/script/timeout at master · github/octocatalog-diff · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
github
/
octocatalog-diff
Public
Notifications
You must be signed in to change notification settings
Fork
96
Star
252
Code
Issues
27
Pull requests
14
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
octocatalog-diff
/
script
/
timeout
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
16 lines (14 loc) · 362 Bytes
Breadcrumbs
octocatalog-diff
/
script
/
timeout
Copy path
File metadata and controls
executable file
·
16 lines (14 loc) · 362 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
#!/usr/bin/env ruby
require
'shellwords'
require
'timeout'
seconds
=
ARGV
.
shift
raise
"Usage:
#{
__FILE__
}
<seconds> <command>"
unless
seconds
begin
Timeout
::
timeout
(
seconds
.
to_i
)
do
system
ARGV
.
map
{
|
i
|
Shellwords
.
escape
(
i
)
}
.
join
(
" "
)
exit
$?
.
exitstatus
end
rescue
Timeout
::
Error
STDERR
.
puts
"Timed out after
#{
seconds
}
seconds"
exit
124
end
Back
|
FazBrowse Home
|
New Git URL