Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
0dd3316c
Commit
0dd3316c
authored
Oct 15, 2014
by
Henry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrote HOME dir lookup (no cgo)
parent
fc6b0d44
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
10 deletions
+2
-10
README.md
README.md
+0
-2
util/util.go
util/util.go
+2
-8
No files found.
README.md
View file @
0dd3316c
...
@@ -22,8 +22,6 @@ NOTES:
...
@@ -22,8 +22,6 @@ NOTES:
all dependencies.
all dependencies.
*
Package managers often contain out-of-date
`golang`
packages.
*
Package managers often contain out-of-date
`golang`
packages.
Compilation from source is recommended.
Compilation from source is recommended.
*
go-ipfs depends on cgo. In case you've disabled cgo, you'll need to
compile with
`CGO_ENABLED=1`
*
If you are interested in development, please install the development
*
If you are interested in development, please install the development
dependencies as well.
dependencies as well.
*
**WARNING: older versions of OSX FUSE (for Mac OS X) can cause kernel panics when mounting!**
*
**WARNING: older versions of OSX FUSE (for Mac OS X) can cause kernel panics when mounting!**
...
...
util/util.go
View file @
0dd3316c
...
@@ -4,7 +4,7 @@ import (
...
@@ -4,7 +4,7 @@ import (
"errors"
"errors"
"io"
"io"
"math/rand"
"math/rand"
"os
/user
"
"os"
"path/filepath"
"path/filepath"
"strings"
"strings"
"time"
"time"
...
@@ -35,13 +35,7 @@ var ErrNotFound = ds.ErrNotFound
...
@@ -35,13 +35,7 @@ var ErrNotFound = ds.ErrNotFound
// TildeExpansion expands a filename, which may begin with a tilde.
// TildeExpansion expands a filename, which may begin with a tilde.
func
TildeExpansion
(
filename
string
)
(
string
,
error
)
{
func
TildeExpansion
(
filename
string
)
(
string
,
error
)
{
if
strings
.
HasPrefix
(
filename
,
"~/"
)
{
if
strings
.
HasPrefix
(
filename
,
"~/"
)
{
usr
,
err
:=
user
.
Current
()
filename
=
strings
.
Replace
(
filename
,
"~"
,
os
.
Getenv
(
"HOME"
),
1
)
if
err
!=
nil
{
return
""
,
err
}
dir
:=
usr
.
HomeDir
+
"/"
filename
=
strings
.
Replace
(
filename
,
"~/"
,
dir
,
1
)
}
}
return
filename
,
nil
return
filename
,
nil
}
}
...
...
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