forked from Silverfish/proton-bridge
Other: Add v2 to module name
This commit is contained in:
@ -23,7 +23,7 @@ import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/tar"
|
||||
"github.com/ProtonMail/proton-bridge/v2/pkg/tar"
|
||||
)
|
||||
|
||||
// InstallNewVersion installs a tgz update package of the given version.
|
||||
|
||||
@ -24,7 +24,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"github.com/ProtonMail/proton-bridge/internal/constants"
|
||||
"github.com/ProtonMail/proton-bridge/v2/internal/constants"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
||||
@ -39,5 +39,5 @@ func fileIsExecutable(path string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
return info.Mode()&0111 != 0
|
||||
return info.Mode()&0o111 != 0
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ import (
|
||||
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"github.com/ProtonMail/gopenpgp/v2/crypto"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/sum"
|
||||
"github.com/ProtonMail/proton-bridge/v2/pkg/sum"
|
||||
)
|
||||
|
||||
const sumFile = ".sum"
|
||||
|
||||
@ -26,8 +26,8 @@ import (
|
||||
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"github.com/ProtonMail/gopenpgp/v2/crypto"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/sum"
|
||||
tests "github.com/ProtonMail/proton-bridge/test"
|
||||
"github.com/ProtonMail/proton-bridge/v2/pkg/sum"
|
||||
tests "github.com/ProtonMail/proton-bridge/v2/test"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@ -120,7 +120,7 @@ func createSignedFiles(t *testing.T, root string, paths ...string) *crypto.KeyRi
|
||||
}
|
||||
|
||||
func makeFile(t *testing.T, path string) {
|
||||
require.NoError(t, os.MkdirAll(filepath.Dir(path), 0700))
|
||||
require.NoError(t, os.MkdirAll(filepath.Dir(path), 0o700))
|
||||
|
||||
f, err := os.Create(path)
|
||||
require.NoError(t, err)
|
||||
@ -141,5 +141,5 @@ func signFile(t *testing.T, path string, kr *crypto.KeyRing) {
|
||||
|
||||
sig, err := kr.SignDetached(crypto.NewPlainMessage(file))
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, ioutil.WriteFile(path+".sig", sig.GetBinary(), 0700))
|
||||
require.NoError(t, ioutil.WriteFile(path+".sig", sig.GetBinary(), 0o700))
|
||||
}
|
||||
|
||||
@ -60,13 +60,13 @@ func newTestVersioner(t *testing.T, exeName, updates string, versions ...string)
|
||||
|
||||
func makeDummyVersionDirectory(t *testing.T, exeName, updates, version string) string {
|
||||
target := filepath.Join(updates, version)
|
||||
require.NoError(t, os.Mkdir(target, 0700))
|
||||
require.NoError(t, os.Mkdir(target, 0o700))
|
||||
|
||||
exe, err := os.Create(filepath.Join(target, getExeName(exeName)))
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, exe)
|
||||
require.NoError(t, exe.Close())
|
||||
require.NoError(t, os.Chmod(exe.Name(), 0700))
|
||||
require.NoError(t, os.Chmod(exe.Name(), 0o700))
|
||||
|
||||
sig, err := os.Create(filepath.Join(target, getExeName(exeName)+".sig"))
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user