diff --git a/Makefile b/Makefile index 11f799ad..c850acb7 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,8 @@ HOST_ARCH=$(shell go env GOARCH) .PHONY: build-local build-local: - go build -o ${DIST_DIR}/${BIN_NAME} + @mkdir -p "${DIST_DIR}" + go build -o "${DIST_DIR}/${BIN_NAME}" .PHONY: clean clean: @@ -27,4 +28,4 @@ build-binaries: .PHONY: build-watcher build-watcher: - go build -o ${DIST_DIR}/${BIN_NAME}-${WATCHER_NAME} ${PACKAGE}/watcher \ No newline at end of file + go build -o ${DIST_DIR}/${BIN_NAME}-${WATCHER_NAME} ${PACKAGE}/watcher diff --git a/cmd/context_test.go b/cmd/context_test.go index 8de7935a..dddd1c38 100644 --- a/cmd/context_test.go +++ b/cmd/context_test.go @@ -2,6 +2,7 @@ package cmd import ( "os" + "path/filepath" "testing" "github.com/microcks/microcks-cli/pkg/config" @@ -36,9 +37,9 @@ users: auth-token: "" refresh-token: ""` -const testConfigFilePath = "./testdata/local.config" - func TestDeleteContext(t *testing.T) { + testConfigFilePath := filepath.Join(t.TempDir(), "local.config") + //write the test config file err := os.WriteFile(testConfigFilePath, []byte(testConfig), os.ModePerm) require.NoError(t, err)