grim/hgkeeper
Clone
Summary
Browse
Changes
Graph
Fix installing python packages via pip
4 months ago, Gary Kramlich
03e8cbced891
Fix installing python packages via pip
package
access
import
(
"fmt"
"os"
"sort"
)
func
refreshHgWeb
()
error
{
fp
,
err
:=
os
.
OpenFile
(
hgwebConfigPath
,
os
.
O_WRONLY
|
os
.
O_TRUNC
,
0644
)
if
err
!=
nil
{
return
err
}
defer
fp
.
Close
()
fmt
.
Fprintf
(
fp
,
"[paths]\n"
)
keys
:=
make
([]
string
,
0
,
len
(
repositories
))
for
k
:=
range
repositories
{
keys
=
append
(
keys
,
k
)
}
sort
.
Strings
(
keys
)
for
_
,
relativeRepoPath
:=
range
keys
{
rootedPath
:=
"/"
+
relativeRepoPath
// check if it's publicly readable
if
CanRead
(
"public"
,
rootedPath
)
{
fmt
.
Fprintf
(
fp
,
"%s = %s\n"
,
rootedPath
,
repositories
[
relativeRepoPath
])
}
}
return
nil
}