Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ruby-build
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ruby-build
Commits
95b32acc
Commit
95b32acc
authored
Sep 08, 2014
by
Mislav Marohnić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve `script/mirror` argument handling
Now supports `-h|--help`.
parent
3add5c46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
script/mirror
+21
-5
No files found.
script/mirror
View file @
95b32acc
#!/usr/bin/env bash
#!/usr/bin/env bash
# Usage: script/mirror update <COMMIT-RANGE>
# Usage: script/mirror update <COMMIT-RANGE>
# script/mirror verify <COMMIT-RANGE>
# script/mirror stats
# script/mirror stats
set
-e
set
-e
commit_range
=
"
${
1
?
}
"
eval
"
$(
grep
RUBY_BUILD_MIRROR_URL
=
./bin/ruby-build | head
-1
)
"
eval
"
$(
grep
RUBY_BUILD_MIRROR_URL
=
./bin/ruby-build | head
-1
)
"
help_text
()
{
sed
-ne
'/^#/!q;s/.\{1,2\}//;1d;p'
<
"
$0
"
}
test_mirrored
()
{
test_mirrored
()
{
curl
-qsSfIL
"
$RUBY_BUILD_MIRROR_URL
/
$1
"
>
/dev/null 2>&1
curl
-qsSfIL
"
$RUBY_BUILD_MIRROR_URL
/
$1
"
>
/dev/null 2>&1
}
}
...
@@ -95,6 +98,19 @@ stats() {
...
@@ -95,6 +98,19 @@ stats() {
echo
"
$confirmed
/
$total
mirrored"
echo
"
$confirmed
/
$total
mirrored"
}
}
cmd
=
"
${
1
?
}
"
cmd
=
"
$1
"
shift
1
"
$cmd
"
"
$@
"
case
"
$cmd
"
in
update
|
verify
|
stats
)
shift
1
"
$cmd
"
"
$@
"
;;
-h
|
--help
)
help_text
exit
0
;;
*
)
help_text
>
&2
exit
1
;;
esac
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment