Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
shenyizhong
/
minsync
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d5df2bdc
authored
Jan 10, 2022
by
shenyizhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* code review
1 parent
aa925ec0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
src/main.go
src/main.go
View file @
d5df2bd
...
...
@@ -32,7 +32,7 @@ func isValidToken(token string) (bool, error) {
func
main
()
{
fmt
.
Println
(
"seetadm v0.0.
4
"
)
fmt
.
Println
(
"seetadm v0.0.
5
"
)
if
len
(
os
.
Args
)
<
6
{
printUsage
()
...
...
@@ -58,6 +58,22 @@ func main() {
nodetree
.
StrDst
=
os
.
Args
[
3
]
}
if
nodetree
.
StrOp
==
"upload"
{
nodetree
.
StrSrc
,
err
=
filepath
.
Abs
(
nodetree
.
StrSrc
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
return
}
nodetree
.
StrSrc
+=
"/"
}
else
if
nodetree
.
StrOp
==
"download"
{
nodetree
.
StrDst
,
err
=
filepath
.
Abs
(
nodetree
.
StrDst
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
return
}
nodetree
.
StrDst
+=
"/"
}
if
nodetree
.
StrHost
==
""
{
fmt
.
Println
(
"parse config error"
)
return
...
...
@@ -108,12 +124,6 @@ func main() {
if
nodetree
.
StrOp
==
"upload"
{
nodetree
.
StrDst
=
"data"
+
nodetree
.
StrDst
nodetree
.
StrSrc
,
err
=
filepath
.
Abs
(
nodetree
.
StrSrc
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
return
}
nodetree
.
StrSrc
+=
"/"
tmpstr
:=
nodetree
.
StrSrc
[
:
len
(
nodetree
.
StrSrc
)
-
1
]
idx
:=
strings
.
LastIndex
(
tmpstr
,
"/"
)
...
...
@@ -149,13 +159,6 @@ func main() {
//out_loc.WriteTo(os.Stdout)
}
else
if
nodetree
.
StrOp
==
"download"
{
nodetree
.
StrDst
,
err
=
filepath
.
Abs
(
nodetree
.
StrDst
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
return
}
nodetree
.
StrDst
+=
"/"
nodetree
.
StrSrc
=
"data"
+
nodetree
.
StrSrc
if
err
!=
nil
{
fmt
.
Println
(
err
)
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment