From 1cdf49af4894d647d8f127dad493d98421d8e79c Mon Sep 17 00:00:00 2001 From: puengel Date: Wed, 6 Mar 2019 09:11:01 +0100 Subject: [PATCH 1/2] Fixed bad reference to copy lib --- go.mod | 5 +---- go.sum | 3 +++ gotron_methods.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index febec65..59f2675 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,13 @@ module github.com/Equanox/gotron require ( - bou.ke/monkey v1.0.1 // indirect github.com/Benchkram/errz v0.0.0-20180825145403-619d291cb54f github.com/davecgh/go-spew v1.1.1 // indirect github.com/gorilla/websocket v1.4.0 github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/otiai10/copy v0.0.0-20180813032824-7e9a647135a1 - github.com/otiai10/mint v1.2.1 // indirect + github.com/otiai10/copy v1.0.1 github.com/pkg/errors v0.8.0 github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/puengel/copy v0.0.0-20190213151652-d7c02ea9f6bd github.com/rs/zerolog v1.11.0 github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b github.com/spf13/cobra v0.0.3 diff --git a/go.sum b/go.sum index 7468590..a83ac0c 100644 --- a/go.sum +++ b/go.sum @@ -10,8 +10,11 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/otiai10/copy v0.0.0-20180813032824-7e9a647135a1 h1:QJNFh2XEtzwESNsblZgBuCsv38DU5vC/u+5DNBekwJM= github.com/otiai10/copy v0.0.0-20180813032824-7e9a647135a1/go.mod h1:pXzZSDlN+HPzSdyIBnKNN9ptD9Hx7iZMWIJPTwo4FPE= +github.com/otiai10/copy v1.0.1 h1:c+B8wnDMTYEWK36PULd7X4IARJDm+ANU2BOCQsfWrgQ= +github.com/otiai10/copy v1.0.1/go.mod h1:8bMCJrAqOtN/d9oyh5HR7HhLQMvcGMpGdwRDYsfOCHc= github.com/otiai10/mint v1.2.1 h1:vDQzXgHumrrZvJp/ftsTB3NUaZQzjEh7HV7Hx27lZj4= github.com/otiai10/mint v1.2.1/go.mod h1:YnfyPNhBvnY8bW4SGQHCs/aAFhkgySlMZbrF5U0bOVw= +github.com/otiai10/mint v1.2.3/go.mod h1:YnfyPNhBvnY8bW4SGQHCs/aAFhkgySlMZbrF5U0bOVw= github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/gotron_methods.go b/gotron_methods.go index 4e288f3..37537c6 100644 --- a/gotron_methods.go +++ b/gotron_methods.go @@ -16,7 +16,7 @@ import ( "github.com/Equanox/gotron/internal/file" "github.com/pkg/errors" - "github.com/puengel/copy" + "github.com/otiai10/copy" "github.com/Benchkram/errz" ) @@ -119,7 +119,7 @@ func (gbw *BrowserWindow) copyElectronApplication(forceInstall bool) (err error) if firstRun || forceInstall { templateDir := filepath.Join(gbwDirectory, templateApplicationDir) - err = copy.Perm(templateDir, gbw.AppDirectory, 0777, 0644) + err = copy.Copy(templateDir, gbw.AppDirectory) errz.Fatal(err) } From 47f3cb2a4a8eba014e74a09cd9ecb2698e9a7843 Mon Sep 17 00:00:00 2001 From: Puengel Date: Wed, 6 Mar 2019 09:54:04 +0100 Subject: [PATCH 2/2] Change permission of .gotron folders --- gotron_methods.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gotron_methods.go b/gotron_methods.go index 37537c6..8793b5d 100644 --- a/gotron_methods.go +++ b/gotron_methods.go @@ -23,6 +23,7 @@ import ( const ( templateApplicationDir = "templates/app" + gotronFileMode = os.FileMode(0755) ) // Start starts an Instance of gotronbrowserwindow @@ -123,6 +124,12 @@ func (gbw *BrowserWindow) copyElectronApplication(forceInstall bool) (err error) errz.Fatal(err) } + err = os.Chmod(gbw.AppDirectory, gotronFileMode) + errz.Fatal(err) + assetsDir := filepath.Join(gbw.AppDirectory, "assets") + err = os.Chmod(assetsDir, gotronFileMode) + errz.Fatal(err) + // If no UI folder is set use default ui files if gbw.UIFolder == "" { return