Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
Feedback fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Clipeus committed Nov 30, 2018
1 parent c9c2a65 commit 2a0f067
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 27 deletions.
8 changes: 4 additions & 4 deletions cmd/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ func Register(ctx *context.StoolContext) {
Description: "Create update for application",
Flags: []cli.Flag{
cli.StringFlag{
Name: "sourceDir, sd",
Usage: "Path to game(short form sd)",
Name: "source, s",
Usage: "Path to game",
Value: "",
Destination: &args.SourceDir,
},
cli.StringFlag{
Name: "outputDir, od",
Usage: "Path to game(short form sd)",
Name: "output, o",
Usage: "Path to game",
Value: "",
Destination: &args.TargetDir,
},
Expand Down
12 changes: 6 additions & 6 deletions cmd/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ func Register(ctx *context.StoolContext) {

Flags: []cli.Flag{
cli.StringFlag{
Name: "sourceOldDir, sod",
Usage: "Path to old files (short form sod)",
Name: "old, o",
Usage: "Path to old files",
Value: "",
Destination: &args.SourceOldDir,
},
cli.StringFlag{
Name: "sourceNewDir, snd",
Usage: "Path to new files (short form snd)",
Name: "new, n",
Usage: "Path to new files",
Value: "",
Destination: &args.SourceNewDir,
},
cli.StringFlag{
Name: "outputDir, od",
Usage: "Path to diff files (short form od)",
Name: "patch, p",
Usage: "Path to patch files",
Value: "",
Destination: &args.OutputDiffDir,
},
Expand Down
4 changes: 2 additions & 2 deletions cmd/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func Register(ctx *context.StoolContext) {

Flags: []cli.Flag{
cli.StringFlag{
Name: "sourceDir, sd",
Usage: "Path to game(short form sd)",
Name: "source, s",
Usage: "Path to game",
Value: "",
Destination: &args.SourceDir,
},
Expand Down
11 changes: 5 additions & 6 deletions cmd/torrent/torrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ func Register(ctx *context.StoolContext) {

Flags: []cli.Flag{
cli.StringFlag{
Name: "sourceDir, sd",
Usage: "Path to game(short form sd)",
Name: "source, s",
Usage: "Path to game",
Value: "",
Destination: &args.SourceDir,
},

cli.StringFlag{
Name: "targetFile, tf",
Name: "target, t",
Usage: "Path for new torrent file",
Value: "",
Destination: &args.TargetFile,
Expand All @@ -51,12 +50,12 @@ func Register(ctx *context.StoolContext) {
Usage: "Slice of torrent web seeds",
},
cli.StringSliceFlag{
Name: "announce-list, a",
Name: "announce-list, al",
Value: &args.AnnounceList,
Usage: "Slice of announce server url",
},
cli.Int64Flag{
Name: "pieceLength, pl",
Name: "piece-length, pl",
Usage: "Torrent piece length",
Value: 512,
Destination: &args.PieceLength,
Expand Down
13 changes: 4 additions & 9 deletions updater/bindiff.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package updater

import (
"fmt"
"os"
"path/filepath"

Expand Down Expand Up @@ -29,8 +28,7 @@ func CreateBinDiff(SourceOldDir string, SourceNewDir string, OutputDiffDir strin
for pathNewFile := range f {
relativePath, err := filepath.Rel(SourceNewDir, pathNewFile)
if err != nil {
fmt.Println(err.Error())
//return err
return err
}

pathOldFile := filepath.Join(SourceOldDir, relativePath)
Expand All @@ -46,8 +44,7 @@ func CreateBinDiff(SourceOldDir string, SourceNewDir string, OutputDiffDir strin
cmp := equalfile.New(nil, equalfile.Options{})
equal, err := cmp.CompareFile(pathOldFile, pathNewFile)
if err != nil {
fmt.Println(err.Error())
//return err
return err
}

if equal {
Expand All @@ -59,14 +56,12 @@ func CreateBinDiff(SourceOldDir string, SourceNewDir string, OutputDiffDir strin
if _, err := os.Stat(pathDiff); os.IsNotExist(err) {
err = os.MkdirAll(pathDiff, 0777)
if err != nil {
fmt.Println(err.Error())
//return err
return err
}
}
err = xdelta.EncodeDiff(pathOldFile, pathNewFile, pathDiffFile)
if err != nil {
fmt.Println(err.Error())
//return err
return err
}
}

Expand Down

0 comments on commit 2a0f067

Please sign in to comment.