Commit b4c26be6 authored by Amos Wenger's avatar Amos Wenger

Move away from wharf

parent bac9d35f
Pipeline #14179 passed with stage
in 2 minutes and 47 seconds
......@@ -7,7 +7,7 @@ import (
"github.com/itchio/ox/syscallex"
"github.com/itchio/ox/winox"
"github.com/itchio/wharf/state"
"github.com/itchio/headway/state"
"github.com/pkg/errors"
)
......
package fuji
import "github.com/itchio/wharf/state"
import "github.com/itchio/headway/state"
type Settings struct {
// CredentialsRegistryKey is the path of a key under HKEY_CURRENT_USER
......
......@@ -8,7 +8,7 @@ import (
"github.com/itchio/ox/syscallex"
"github.com/itchio/ox/winox"
"github.com/itchio/wharf/state"
"github.com/itchio/headway/state"
"github.com/pkg/errors"
)
......
......@@ -7,7 +7,7 @@ import (
"time"
"github.com/itchio/ox/winox"
"github.com/itchio/wharf/state"
"github.com/itchio/headway/state"
"github.com/pkg/errors"
)
......
......@@ -3,9 +3,9 @@ module github.com/itchio/smaug
go 1.12
require (
github.com/itchio/ox v0.0.0-20190320095717-ec75be15423d
github.com/itchio/wharf v0.0.0-20181213155255-5c074d8f87a4
github.com/itchio/headway v0.0.0-20190702175331-a4c65c5306de
github.com/itchio/ox v0.0.0-20190702183250-92ed53dc0fa5
github.com/pkg/errors v0.8.1
github.com/stretchr/testify v1.3.0
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb
)
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/itchio/ox v0.0.0-20190320095717-ec75be15423d h1:HaR21jbp35shw+e8YhElQUEA6rW3ZRFlbzY3QnxO4JI=
github.com/itchio/ox v0.0.0-20190320095717-ec75be15423d/go.mod h1:RL0BnbgbEihBjUuRmnM3ZnHFE/mU2l72fTaac9fSels=
github.com/itchio/wharf v0.0.0-20181213155255-5c074d8f87a4 h1:+lsGaAGakbMki2lTQWUNkGy91RMx17R58RH4GnqeRsU=
github.com/itchio/wharf v0.0.0-20181213155255-5c074d8f87a4/go.mod h1:+POTUNOKzhCiFy3BM0Qb7RHLTHazlOcypTnt7QbOeks=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/itchio/headway v0.0.0-20190702175331-a4c65c5306de h1:RQW9xPqYtvjdHHRZR95XsaEA9B4URCuNHK78IuJcc+Y=
github.com/itchio/headway v0.0.0-20190702175331-a4c65c5306de/go.mod h1:Iif+7HeesRB0PvTYf0gOIFX8lj0za0SUsWryENQYt1E=
github.com/itchio/ox v0.0.0-20190702183250-92ed53dc0fa5 h1:8Wi95IwkUGZTGhVmylXAnCW/iUe9nUEtKYKLyhsseuM=
github.com/itchio/ox v0.0.0-20190702183250-92ed53dc0fa5/go.mod h1:POv3yZKXDBTjmHRY+4ICAitLMtCwTwPjq9EOZOvRpok=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709 h1:Ko2LQMrRU+Oy/+EDBwX7eZ2jp3C47eDBB8EIhKTun+I=
github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb h1:fgwFCsaw9buMuxNd6+DQfAuSFqbNiQZpcgJQAgJsK6k=
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
......@@ -11,7 +11,7 @@ import (
"github.com/itchio/ox/winox"
"github.com/itchio/ox/winox/execas"
"github.com/itchio/smaug/fuji"
"github.com/itchio/wharf/state"
"github.com/itchio/headway/state"
"github.com/pkg/errors"
)
......
......@@ -6,9 +6,8 @@ import (
"path/filepath"
"testing"
"github.com/itchio/headway/state"
"github.com/itchio/smaug/runner"
"github.com/itchio/wharf/state"
"github.com/itchio/wharf/wtest"
"github.com/stretchr/testify/assert"
)
......@@ -16,12 +15,12 @@ func Test_PrepareMacLaunchTarget(t *testing.T) {
assert := assert.New(t)
installFolder, err := ioutil.TempDir("", "install-folder")
wtest.Must(t, err)
tmust(t, err)
defer os.RemoveAll(installFolder)
t.Logf("Regular app bundle")
bundlePath := filepath.Join(installFolder, "Foobar.app")
wtest.Must(t, os.MkdirAll(bundlePath, 0755))
tmust(t, os.MkdirAll(bundlePath, 0755))
consumer := &state.Consumer{
OnMessage: func(lvl string, msg string) {
......@@ -42,8 +41,8 @@ func Test_PrepareMacLaunchTarget(t *testing.T) {
t.Logf("Naked executable (not in bundle)")
nakedExecPath := filepath.Join(installFolder, "utilities", "x86_64", "bin", "jtool")
wtest.Must(t, os.MkdirAll(filepath.Dir(nakedExecPath), 0755))
wtest.Must(t, ioutil.WriteFile(nakedExecPath, machoHeader, 0755))
tmust(t, os.MkdirAll(filepath.Dir(nakedExecPath), 0755))
tmust(t, ioutil.WriteFile(nakedExecPath, machoHeader, 0755))
params.FullTargetPath = nakedExecPath
target, err = runner.PrepareMacLaunchTarget(params)
......@@ -53,8 +52,8 @@ func Test_PrepareMacLaunchTarget(t *testing.T) {
t.Logf("Nested executable (in bundle)")
nestedExecPath := filepath.Join(bundlePath, "Contents", "MacOS", "crabapple-launcher")
wtest.Must(t, os.MkdirAll(filepath.Dir(nestedExecPath), 0755))
wtest.Must(t, ioutil.WriteFile(nestedExecPath, machoHeader, 0755))
tmust(t, os.MkdirAll(filepath.Dir(nestedExecPath), 0755))
tmust(t, ioutil.WriteFile(nestedExecPath, machoHeader, 0755))
params.FullTargetPath = nestedExecPath
target, err = runner.PrepareMacLaunchTarget(params)
......@@ -62,3 +61,13 @@ func Test_PrepareMacLaunchTarget(t *testing.T) {
assert.EqualValues(bundlePath, target.Path)
assert.True(target.IsAppBundle)
}
// tmust shows a complete error stack and fails a test immediately
// if err is non-nil
func tmust(t *testing.T, err error) {
if err != nil {
t.Helper()
t.Errorf("%+v", err)
t.FailNow()
}
}
......@@ -7,7 +7,7 @@ import (
"os/exec"
"syscall"
"github.com/itchio/wharf/state"
"github.com/itchio/headway/state"
"github.com/pkg/errors"
)
......
......@@ -9,7 +9,7 @@ import (
"github.com/itchio/ox/syscallex"
"github.com/itchio/ox/winox/execas"
"github.com/itchio/wharf/state"
"github.com/itchio/headway/state"
"github.com/pkg/errors"
)
......
......@@ -8,7 +8,7 @@ import (
"github.com/itchio/ox"
"github.com/itchio/smaug/fuji"
"github.com/itchio/wharf/state"
"github.com/itchio/headway/state"
)
type RunnerParams struct {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment