Skip to content

Commit ea0a6fa

Browse files
committed
Update user homedir and restore form
1 parent 8115a3b commit ea0a6fa

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

application.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (h *Updemia) Render() string {
5252
</div>
5353
{{else}}
5454
<div class="HelloBox center">
55-
55+
<form action="#">
5656
<img src="http://www.updemia.com/images/logo.png" alt="" />
5757
<h1>
5858
Hello, you
@@ -70,6 +70,7 @@ func (h *Updemia) Render() string {
7070
onkeyup="Passphrase" required="required" />
7171
7272
<input type="submit" value="Start" class="btn" onclick="OnUserLog" />
73+
</form>
7374
</div>
7475
{{end}}
7576
</div>

updemia.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import (
66
"fmt"
77
"github.com/atotto/clipboard"
88
"github.com/howeyc/fsnotify"
9+
"github.com/mitchellh/go-homedir"
910
"io"
1011
"io/ioutil"
1112
"log"
1213
"mime/multipart"
1314
"net/http"
1415
"os"
15-
"os/user"
1616
"path/filepath"
1717
"strings"
1818
)
@@ -61,14 +61,14 @@ func watchUploadFolder() {
6161
}
6262

6363
func getDestinationPath() string {
64-
usr, err := user.Current()
64+
usrDir, err := homedir.Dir()
6565
if err != nil {
6666
log.Fatal(err)
6767
}
6868

6969
var destination_path bytes.Buffer
7070

71-
destination_path.WriteString(usr.HomeDir)
71+
destination_path.WriteString(usrDir)
7272
destination_path.WriteString(defaultDestinationPath)
7373

7474
os.MkdirAll(destination_path.String(), os.ModePerm)

0 commit comments

Comments
 (0)