Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F393992
update-all-repos.sh
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
hach-que
May 7 2015, 12:48 AM
2015-05-07 00:48:34 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
update-all-repos.sh
View Options
#!/bin/omni
:
$json
=
$(
echo
'{}'
|
arc --conduit-uri
=
https://secure.phabricator.com/ call-conduit repository.query
)
:
$repos
=
<?php
return
json_decode
(
$shell
->getVariable
(
'json'
)
,
true
)
;
?>
:
$futures
=
@
()
:
$shouldClone
=
()
=
>
{
return
(
<?php
$arr
=
$shell
->getVariable
(
'1'
)
->getCopy
()
;
return
!is_dir
(
$arr
[
'callsign'
])
&&
idx
(
$arr
,
'uri'
)
!
==
null
;
?>
)
;
}
:
$directoryExists
=
()
=
>
{
return
(
<?php
$arr
=
$shell
->getVariable
(
'1'
)
->getCopy
()
;
return
is_dir
(
$arr
[
'callsign'
])
;
?>
)
;
}
:
$reposCloned
=
@
()
foreach
(
$repos
->response
)
as
$repo
{
if
(
$shouldClone
(
$repo
))
{
:
$futures
->
(
$repo
->callsign
)
=
$(
new -t ExecFuture
"%s clone %s %s"
(
$repo
->vcs
)
(
$repo
->uri
)
(
$repo
->callsign
))
}
else
{
if
(
$directoryExists
(
$repo
))
{
:
$reposCloned
->
[]
=
(
$repo
->callsign
)
;
}
echo
(
"Not cloning "
+
$repo
->callsign
)
}
}
echo
"Cloning repositories in parallel..."
foreach
$(
futures
$futures
)
as
$callsign
=
>
$future
{
:
$result
=
(
$future
->resolve
())
if
(
<?php
return
idx
(
$shell
->getVariable
(
'result'
)
->getCopy
()
,
'0'
)
==
0
;
?>
)
{
:
$reposCloned
->
[]
=
$callsign
echo
(
""
+
$callsign
+
" cloned"
)
}
else
{
echo
(
""
+
$callsign
+
" could not be cloned"
)
}
}
foreach
$reposCloned
as
$repo
{
cd
$repo
../modify-commit-and-push.sh
&
cd
..
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/uv/ex/xjh3hwiinlvv7pc4
Default Alt Text
update-all-repos.sh (1 KB)
Attached To
Mode
P1774 update-all-repos.sh
Attached
Detach File
Event Timeline
Log In to Comment