Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions pkg/export/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ import (
"errors"
"flag"
"fmt"
"github.com/genshen/cmds"
"github.com/genshen/pkg"
"github.com/mholt/archives"
log "github.com/sirupsen/logrus"
"os"
"path/filepath"
"strings"
"time"

"github.com/genshen/cmds"
"github.com/genshen/pkg"
"github.com/mholt/archives"
log "github.com/sirupsen/logrus"
)

var exportCommand = &cmds.Command{
Name: "export",
Summary: "export dependency packages export a tarball file",
Summary: "export dependency packages to a tarball file",
Description: "export dependency packages to a tarball file (.tar) specified by a file path",
CustomFlags: false,
HasOptions: true,
Expand Down
4 changes: 2 additions & 2 deletions pkg/fetch/cache_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const (
CacheStrategyCopyFromGlobalCache CacheStrategy = iota // package exits at user home's global cache directory.
CacheStrategyUserLocalVendor CacheStrategy = iota // package exist in project's vendor/src directory.
CacheStrategySkip CacheStrategy = iota // skip package downloading or local copying
CacheStrategyDefault CacheStrategy = CacheStrategyDownloadFromRemote // package exist in project's vendor/src directory.
CacheStrategyDefault = CacheStrategyDownloadFromRemote // package exist in project's vendor/src directory.
)

type CacheStrategy int
Expand All @@ -29,7 +29,7 @@ func determinePackageCacheStrategy(packageMeta pkg.PackageMeta, projectRoot stri
return nil, CacheStrategyDownloadFromRemote
}
return err, CacheStrategySkip
} else { // vendor src does not exist, but global cache exist.
} else { // vendor src does not exist, but global cache exist.
if noCache { // if noCache, directly download. Don't use global cache.
return err, CacheStrategyDownloadFromRemote
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/fetch/cmake_lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package fetch
import (
"bufio"
"fmt"
"github.com/genshen/pkg"
log "github.com/sirupsen/logrus"
"io"
"os"
"path/filepath"
"strings"
"text/template"

"github.com/genshen/pkg"
log "github.com/sirupsen/logrus"
)

type cmakeDepData struct {
Expand Down
3 changes: 2 additions & 1 deletion pkg/fetch/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package fetch

import (
"fmt"
"github.com/genshen/pkg"
"log"

"github.com/genshen/pkg"
)

const FEATURE_DEBUG = true
Expand Down
11 changes: 6 additions & 5 deletions pkg/fetch/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import (
"errors"
"flag"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"text/template"

"github.com/AlecAivazis/survey/v2"
"github.com/genshen/cmds"
"github.com/genshen/pkg"
Expand All @@ -13,11 +19,6 @@ import (
"github.com/rogpeppe/go-internal/semver"
log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v3"
"io"
"os"
"path/filepath"
"strings"
"text/template"
)

var fetchCommand = &cmds.Command{
Expand Down
4 changes: 2 additions & 2 deletions pkg/fetch/src_dl.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func archiveSrc(archiveType string, srcPath string, packageName string, remoteUr
archiveType = pkg.DefaultArchiveFormatType
log.WithFields(log.Fields{
"pkg": packageName,
}).Info("set archive package format type to default type: %s.", archiveType)
}).Infof("set archive package format type to default type: %s.", archiveType)
}

// save file.
Expand Down Expand Up @@ -267,7 +267,7 @@ func gitSrc(auths map[string]conf.Auth, packageCacheDir, packagePath, packageUrl
URL: proxyUrl,
},
}); err != nil {
log.Println("Error here", err)
log.Println("Error here", err, repoUrl)
return err
} else { // clone succeed.
// set filemode to false for Windows system
Expand Down
7 changes: 4 additions & 3 deletions pkg/import/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@ import (
"errors"
"flag"
"fmt"
"os"
"path/filepath"

"github.com/genshen/cmds"
"github.com/genshen/pkg"
"github.com/mholt/archives"
cp "github.com/otiai10/copy"
log "github.com/sirupsen/logrus"
"os"
"path/filepath"
)

const ImportCacheDir = ".import.cache"

var importCommand = &cmds.Command{
Name: "import",
Summary: "import dependency packages from tarball file",
Description: "import and extract dependency packages from tarball file (.tar) specified by a file path",
Description: "import and extract dependency packages from tarball file (.tar.gz) specified by a file path",
CustomFlags: false,
HasOptions: true,
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package init
import (
"errors"
"flag"
"os"
"path/filepath"

"github.com/genshen/cmds"
"github.com/genshen/pkg"
"gopkg.in/yaml.v3"
"os"
"path/filepath"
)

var initCommand = &cmds.Command{
Expand Down
3 changes: 2 additions & 1 deletion pkg/install/build_pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package install

import (
"fmt"
"github.com/genshen/pkg"
"strings"

"github.com/genshen/pkg"
)

// build pkg from dependency tree.
Expand Down
5 changes: 3 additions & 2 deletions pkg/install/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package install
import (
"errors"
"fmt"
"github.com/genshen/pkg"
log "github.com/sirupsen/logrus"
"io"
"os"
"os/exec"
"path/filepath"
"strings"

"github.com/genshen/pkg"
log "github.com/sirupsen/logrus"
)

// run the instruction
Expand Down
3 changes: 2 additions & 1 deletion pkg/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import (
"errors"
"flag"
"fmt"
"os"

"github.com/genshen/cmds"
"github.com/genshen/pkg"
log "github.com/sirupsen/logrus"
"os"
)

var buildCommand = &cmds.Command{
Expand Down
3 changes: 2 additions & 1 deletion pkg/install/install_shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"bufio"
"errors"
"fmt"
"github.com/genshen/pkg"
"os"
"path/filepath"
"strings"

"github.com/genshen/pkg"
)

// writer instructions as shell format to file
Expand Down
5 changes: 3 additions & 2 deletions pkg/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"errors"
"flag"
"fmt"
"github.com/genshen/cmds"
"github.com/genshen/pkg"
"os"
"sort"

"github.com/genshen/cmds"
"github.com/genshen/pkg"
)

var listCommand = &cmds.Command{
Expand Down
5 changes: 3 additions & 2 deletions pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package version
import (
"flag"
"fmt"

"github.com/genshen/cmds"
"github.com/genshen/pkg"
)
Expand All @@ -16,8 +17,8 @@ var versionCommand = &cmds.Command{
}

var (
GitCommitID string = "unknown"
BuildTime string = ""
GitCommitID = "unknown"
BuildTime = ""
)

func init() {
Expand Down