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
b4fd8e94
Commit
b4fd8e94
authored
Apr 18, 2013
by
Sam Stephenson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract `sanitize` helper
parent
30648866
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
bin/ruby-build
+6
-2
No files found.
bin/ruby-build
View file @
b4fd8e94
...
@@ -61,6 +61,10 @@ capitalize() {
...
@@ -61,6 +61,10 @@ capitalize() {
printf
"%s"
"
$1
"
| tr a-z A-Z
printf
"%s"
"
$1
"
| tr a-z A-Z
}
}
sanitize
()
{
printf
"%s"
"
$1
"
| sed
"s/[^A-Za-z0-9.-]/_/g; s/__*/_/g"
}
build_failed
()
{
build_failed
()
{
{
echo
{
echo
echo
"BUILD FAILED"
echo
"BUILD FAILED"
...
@@ -294,10 +298,10 @@ fetch_git() {
...
@@ -294,10 +298,10 @@ fetch_git() {
if
type
git &>/dev/null
;
then
if
type
git &>/dev/null
;
then
if
[
-n
"
$RUBY_BUILD_CACHE_PATH
"
]
;
then
if
[
-n
"
$RUBY_BUILD_CACHE_PATH
"
]
;
then
pushd
"
$RUBY_BUILD_CACHE_PATH
"
>
&4
pushd
"
$RUBY_BUILD_CACHE_PATH
"
>
&4
local
clone_name
=
$(
echo
$git_url
| sed
"s/[^A-Za-z0-9.-]/_/g; s/__*/_/g"
)
local
clone_name
=
"
$(
sanitize
"
$git_url
"
)
"
if
[
-e
"
${
clone_name
}
"
]
;
then
if
[
-e
"
${
clone_name
}
"
]
;
then
{
cd
"
${
clone_name
}
"
{
cd
"
${
clone_name
}
"
git fetch
--force
"
$git_url
"
"+
${
git_ref
}
:
${
git_ref
}
"
git fetch
--force
"
$git_url
"
"+
${
git_ref
}
:
${
git_ref
}
"
}
>
&4 2>&1
}
>
&4 2>&1
else
else
git clone
--bare
--branch
"
$git_ref
"
"
$git_url
"
"
${
clone_name
}
"
>
&4 2>&1
git clone
--bare
--branch
"
$git_ref
"
"
$git_url
"
"
${
clone_name
}
"
>
&4 2>&1
...
...
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