Add package manager usage docs

Signed-off-by: Tihomir Jovicic <tihomir.jovicic.develop@gmail.com>
This commit is contained in:
Tihomir Jovicic
2021-08-23 12:30:19 +02:00
parent 620a37715c
commit 8aaaacc9da
3 changed files with 135 additions and 13 deletions

View File

@@ -158,8 +158,8 @@ func (f *file) processRequire(req *require, upgrade bool) (bool, error) {
return isNew, err
}
// the existing requirement is newer so we skip installation
if c > 0 {
// the existing requirement is newer or equal so we skip installation
if c >= 0 {
return isNew, nil
}

View File

@@ -16,25 +16,25 @@ func TestClone(t *testing.T) {
{
name: "resolving shorter hash version",
require: require{
cloneRepo: "github.com/tjovicic/gcpcloudrun-cue",
clonePath: "",
version: "d530f2ea2099",
cloneRepo: "github.com/tjovicic/dagger-modules",
clonePath: "gcpcloudrun",
version: "f4a5110b86a43871",
},
},
{
name: "resolving branch name",
require: require{
cloneRepo: "github.com/tjovicic/gcpcloudrun-cue",
clonePath: "",
cloneRepo: "github.com/tjovicic/dagger-modules",
clonePath: "gcpcloudrun",
version: "main",
},
},
{
name: "resolving tag",
require: require{
cloneRepo: "github.com/tjovicic/gcpcloudrun-cue",
clonePath: "",
version: "v0.3",
cloneRepo: "github.com/tjovicic/dagger-modules",
clonePath: "gcpcloudrun",
version: "v0.1",
},
},
{
@@ -74,12 +74,12 @@ func TestListTags(t *testing.T) {
defer os.Remove(tmpDir)
r, err := clone(&require{
cloneRepo: "github.com/tjovicic/gcpcloudrun-cue",
clonePath: "",
cloneRepo: "github.com/tjovicic/dagger-modules",
clonePath: "gcpcloudrun",
version: "",
}, tmpDir, "", "")
if err != nil {
t.Error(err)
t.Fatal(err)
}
tags, err := r.listTags()